Class: CanTango::PermissionEngine
- Defined in:
- lib/cantango/adapter/moneta.rb,
lib/cantango/permission_engine.rb,
lib/cantango/permission_engine/store.rb,
lib/cantango/permission_engine/loader.rb,
lib/cantango/permission_engine/parser.rb,
lib/cantango/permission_engine/factory.rb,
lib/cantango/permission_engine/compiler.rb,
lib/cantango/permission_engine/selector.rb,
lib/cantango/permission_engine/collector.rb,
lib/cantango/permission_engine/evaluator.rb,
lib/cantango/permission_engine/statement.rb,
lib/cantango/permission_engine/permission.rb,
lib/cantango/permission_engine/statements.rb,
lib/cantango/permission_engine/yaml_store.rb,
lib/cantango/permission_engine/loader/base.rb,
lib/cantango/permission_engine/parser/rule.rb,
lib/cantango/permission_engine/moneta_store.rb,
lib/cantango/permission_engine/parser/regex.rb,
lib/cantango/permission_engine/selector/base.rb,
lib/cantango/permission_engine/parser/default.rb,
lib/cantango/permission_engine/selector/roles.rb,
lib/cantango/permission_engine/selector/users.rb,
lib/cantango/permission_engine/parser/category.rb,
lib/cantango/permission_engine/parser/ownership.rb,
lib/cantango/permission_engine/loader/categories.rb,
lib/cantango/permission_engine/parser/categories.rb,
lib/cantango/permission_engine/selector/licenses.rb,
lib/cantango/permission_engine/loader/permissions.rb,
lib/cantango/permission_engine/parser/permissions.rb,
lib/cantango/permission_engine/parser/relationship.rb,
lib/cantango/permission_engine/selector/user_types.rb,
lib/cantango/permission_engine/selector/role_groups.rb,
lib/cantango/permission_engine/selector/account_types.rb
Defined Under Namespace
Modules: Loader, Parser, Selector Classes: Collector, Compiler, Evaluator, Factory, MonetaStore, Permission, Statement, Statements, Store, YamlStore
Instance Attribute Summary
Attributes inherited from Engine
Instance Method Summary collapse
- #engine_name ⇒ Object (also: #cache_key)
-
#initialize(ability) ⇒ PermissionEngine
constructor
A new instance of PermissionEngine.
- #permissions ⇒ Object
- #permit_rules ⇒ Object
- #valid? ⇒ Boolean
Methods included from Ability::UserHelpers
#user, #user_account, #user_key_field
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::Executor
#cache, #clear_rules!, #execute!, #rules
Methods included from Ability::CacheHelpers
Methods included from Helpers::Debug
Methods inherited from Engine
Constructor Details
#initialize(ability) ⇒ PermissionEngine
Returns a new instance of PermissionEngine.
11 12 13 |
# File 'lib/cantango/permission_engine.rb', line 11 def initialize ability super end |
Instance Method Details
#engine_name ⇒ Object Also known as: cache_key
21 22 23 |
# File 'lib/cantango/permission_engine.rb', line 21 def engine_name :permission end |
#permissions ⇒ Object
31 32 33 |
# File 'lib/cantango/permission_engine.rb', line 31 def .build! end |
#permit_rules ⇒ Object
15 16 17 18 19 |
# File 'lib/cantango/permission_engine.rb', line 15 def permit_rules .each do || .evaluate! user end end |
#valid? ⇒ Boolean
25 26 27 28 29 |
# File 'lib/cantango/permission_engine.rb', line 25 def valid? puts "valid_mode? #{valid_mode?} #{modes} #{cached?}" return false if !valid_mode? .empty? ? invalid : true end |