Sha256: 0fdfc14b3b077ebfbdf53ef17658f162b0de68047705254a36feecd2ec260b5b

Contents?: true

Size: 504 Bytes

Versions: 2

Compression:

Stored size: 504 Bytes

Contents

module Kublog
  module UserIntegration
    module Devise
      
      def self.included(base)
        base.send :include, InstanceMethods
        base.send :helper_method,:is_admin?
      end
      
      module InstanceMethods
        
        # Uses the already defined current_user method by Devise
        # get the admin? value to filter out publishing actions
        
        def is_admin?
          current_user && current_user.try(:admin?)
        end
        
      end
      
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
kublog-0.9.0 lib/kublog/user_integration/devise.rb
kublog-0.0.1.1 lib/kublog/user_integration/devise.rb