Class: Decidim::Authorization

Inherits:
ApplicationRecord show all
Defined in:
app/models/decidim/authorization.rb

Overview

An authorization is a record that a User has been authorized somehow. Other models in the system can use different kind of authorizations to allow a user to perform actions.

To create an authorization for a user we need to use an AuthorizationHandler that validates the user against a set of rules. An example could be a handler that validates a user email against an API and depending on the response it allows the creation of the authorization or not.

Instance Method Summary collapse

Instance Method Details

#handlerObject

The handler that created this authorization.

Returns an instance that inherits from Decidim::AuthorizationHandler.



22
23
24
# File 'app/models/decidim/authorization.rb', line 22

def handler
  @handler ||= AuthorizationHandler.handler_for(name, )
end