Class: Decidim::Authorization
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Decidim::Authorization
- 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
-
#handler ⇒ Object
The handler that created this authorization.
Instance Method Details
#handler ⇒ Object
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 |