Sha256: a37292a81f64abfac1ab2ee1f09c3c8c226a3ba84704af90c1c0b139bf02d363

Contents?: true

Size: 572 Bytes

Versions: 5

Compression:

Stored size: 572 Bytes

Contents

module CanTango
  module Users
    module User

      # include Masquerade

      attr_accessor :active_account

      def active_user
        @active_user || self
      end

      def can? *args
        CanTango::Ability.new(active_account).can?(*args)
      end

      def cannot? *args
        CanTango::Ability.new(active_account).cannot?(*args)
      end

      def active_account
        @active_account || self
      end

      def self.included(base)
        CanTango.config.users.register base.name.underscore.gsub(/_user$/, ''), base
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cantango-0.9.4.7 lib/cantango/users/user.rb
cantango-0.9.4.6 lib/cantango/users/user.rb
cantango-0.9.4.5 lib/cantango/users/user.rb
cantango-0.9.4.3 lib/cantango/users/user.rb
cantango-0.9.4.2 lib/cantango/users/user.rb