Method: Ratify::ClassMethods#permit

Defined in:
lib/ratify.rb

#permit(object, *actions, **conditions) ⇒ Array<Permission>

Creates a new permission for the object.

Examples:

Basic usage

include Ratify
permit User, :create, :read, :update, :destroy, if: :admin?

Returns:

  • (Array<Permission>)

    All of the permissions after they’re updated.



40
41
42
# File 'lib/ratify.rb', line 40

def permit(object, *actions, **conditions)
  permissions << Permission.new(object, *actions, **conditions)
end