Class: Granite::Action::Policies::AnyStrategy
- Inherits:
-
Object
- Object
- Granite::Action::Policies::AnyStrategy
- Defined in:
- lib/granite/action/policies/any_strategy.rb
Overview
Granite BA policy which allows action to be performed if at least one defined policy evaluates to true
Direct Known Subclasses
Class Method Summary collapse
Class Method Details
.allowed?(action) ⇒ Boolean
6 7 8 |
# File 'lib/granite/action/policies/any_strategy.rb', line 6 def self.allowed?(action) action._policies.any? { |policy| action.instance_exec(action.performer, &policy) } end |