Module: CanTango::Ability::Executor
Instance Method Summary
collapse
#config, #has_role_group_meth, #has_role_meth, #role_groups_list_meth, #roles_list_meth
#debug
Instance Method Details
#cache ⇒ Object
34
35
36
|
# File 'lib/cantango/ability/executor.rb', line 34
def cache
@cache ||= CanTango::Ability::Cache.new self, :cache_key => cache_key, :key_method_names => key_method_names
end
|
#clear_rules! ⇒ Object
26
27
28
|
# File 'lib/cantango/ability/executor.rb', line 26
def clear_rules!
@rules ||= []
end
|
#engine_name ⇒ Object
38
39
40
|
# File 'lib/cantango/ability/executor.rb', line 38
def engine_name
:permit
end
|
#execute! ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/cantango/ability/executor.rb', line 9
def execute!
return if !valid?
start_execute
return cached_rules if cached? && cached_rules?
clear_rules!
permit_rules
cache_rules! if cached?
end_execute
rules
end
|
#permit_rules ⇒ Object
30
31
32
|
# File 'lib/cantango/ability/executor.rb', line 30
def permit_rules
raise NotImplementedError
end
|
#rules ⇒ Object
22
23
24
|
# File 'lib/cantango/ability/executor.rb', line 22
def rules
@rules ||= []
end
|
#valid? ⇒ Boolean
42
43
44
|
# File 'lib/cantango/ability/executor.rb', line 42
def valid?
raise NotImplementedError
end
|