Class: ForestLiana::Ability::Permission::SmartActionChecker
- Inherits:
-
Object
- Object
- ForestLiana::Ability::Permission::SmartActionChecker
- Defined in:
- app/services/forest_liana/ability/permission/smart_action_checker.rb
Instance Method Summary collapse
- #can_execute? ⇒ Boolean
-
#initialize(parameters, collection, smart_action, user) ⇒ SmartActionChecker
constructor
A new instance of SmartActionChecker.
Constructor Details
#initialize(parameters, collection, smart_action, user) ⇒ SmartActionChecker
Returns a new instance of SmartActionChecker.
6 7 8 9 10 11 |
# File 'app/services/forest_liana/ability/permission/smart_action_checker.rb', line 6 def initialize(parameters, collection, smart_action, user) @parameters = parameters @collection = collection @smart_action = smart_action @user = user end |
Instance Method Details
#can_execute? ⇒ Boolean
13 14 15 16 17 18 19 |
# File 'app/services/forest_liana/ability/permission/smart_action_checker.rb', line 13 def can_execute? if @parameters[:data][:attributes][:signed_approval_request].present? && @smart_action['userApprovalEnabled'].include?(@user['roleId']) can_approve? else can_trigger? end end |