Method: Ratify::ClassMethods#permits?

Defined in:
lib/ratify.rb

#permits?(object, *actions, scope: nil) ⇒ true | false

Checks if the given object is allowed to perform the requested action(s).

Parameters:

  • object (Object)

    The object requesting the action(s).

  • actions (*Symbol)

    The action(s) being requested.

  • scope (Object) (defaults to: nil)

    The scope of permissible object.

Returns:

  • (true | false)

    Whether or not the object is permitted.



50
51
52
# File 'lib/ratify.rb', line 50

def permits?(object, *actions, scope: nil)
  permissions.any? { |m| m.permits?(object, *actions, scope: scope) }
end