Module: Authorization::OperatorMixin
- Defined in:
- lib/role-authz/authorization/operator_mixin.rb
Instance Method Summary collapse
Instance Method Details
#authorized?(args = {}) ⇒ Boolean
3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/role-authz/authorization/operator_mixin.rb', line 3 def (args = {}) @roles ||= Authorization.roles_for(self, args[:target]) if args[:action].nil? @roles.include?(args[:role]) else target = args[:target]. unless args[:target]..nil? @roles.each do |role| actions = target..actions_for(role) return true if actions.include?(args[:action]) || actions.include?(:all) end false end end |