Class: Objectify::PolicyChainExecutor
- Inherits:
-
Object
- Object
- Objectify::PolicyChainExecutor
- Includes:
- Instrumentation
- Defined in:
- lib/objectify/policy_chain_executor.rb
Instance Method Summary collapse
- #call(action) ⇒ Object
-
#initialize(executor, context) ⇒ PolicyChainExecutor
constructor
A new instance of PolicyChainExecutor.
Constructor Details
#initialize(executor, context) ⇒ PolicyChainExecutor
Returns a new instance of PolicyChainExecutor.
7 8 9 10 |
# File 'lib/objectify/policy_chain_executor.rb', line 7 def initialize(executor, context) @executor = executor @context = context end |
Instance Method Details
#call(action) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/objectify/policy_chain_executor.rb', line 12 def call(action) action.policies.each do |policy| if !@executor.call(policy, :policy) responder = @context.policy_responder(policy) instrument("policy_chain_halted.objectify", :policy => policy, :responder => responder) @executor.call(responder, :responder) return false end end true end |