Class: CanTango::CachedAbility
- Defined in:
- lib/cantango/cached_ability.rb
Instance Attribute Summary
Attributes inherited from Ability
Instance Method Summary collapse
- #cached? ⇒ Boolean
-
#initialize(candidate, options = {}) ⇒ CachedAbility
constructor
Equivalent to a CanCan Ability#initialize call which executes all the permission logic.
- #permit_rules ⇒ Object
Methods inherited from Ability
#clear_rules!, #config, #session, #subject
Methods included from Ability::RoleHelpers
Methods included from Helpers::RoleMethods
#config, #has_role_group_meth, #has_role_meth, #role_groups_list_meth, #roles_list_meth
Methods included from Ability::UserHelpers
#user, #user_account, #user_key_field
Methods included from Ability::PermitHelpers
Methods included from Ability::MasqueradeHelpers
#masquerade_account?, #masquerade_user?, #masquerading?, #masquerading_off?
Methods included from Ability::CacheHelpers
Methods included from Ability::EngineHelpers
#each_engine, #engines, #engines_on?, #execute_engines!, #opts_engines_off?
Methods included from PermitEngine::Util
#localhost_manager?, #permit_name, #role
Constructor Details
#initialize(candidate, options = {}) ⇒ CachedAbility
Equivalent to a CanCan Ability#initialize call which executes all the permission logic
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/cantango/cached_ability.rb', line 5 def initialize candidate, = {} raise "Candidate must be something!" if !candidate @candidate, @options = candidate, # return if cached_rules? clear_rules! permit_rules execute_engines! if engines_on? # cache_rules! end |
Instance Method Details
#cached? ⇒ Boolean
19 20 21 |
# File 'lib/cantango/cached_ability.rb', line 19 def cached? true end |
#permit_rules ⇒ Object
23 24 |
# File 'lib/cantango/cached_ability.rb', line 23 def permit_rules end |