Sha256: 69d89f680e63367f4425707f98a75aff2ce65f017b8e62ae9a541fd484fff2af

Contents?: true

Size: 553 Bytes

Versions: 3

Compression:

Stored size: 553 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, base
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cantango-0.9.4.1 lib/cantango/users/user.rb
cantango-0.9.4 lib/cantango/users/user.rb
cantango-0.9.3.2 lib/cantango/users/user.rb