Class: Authority::Authorizer
- Inherits:
-
Object
- Object
- Authority::Authorizer
- Defined in:
- lib/authority/authorizer.rb
Instance Attribute Summary collapse
-
#resource ⇒ Object
readonly
The base Authorizer class, from which all the authorizers in an app will descend.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(resource) ⇒ Authorizer
constructor
A new instance of Authorizer.
Constructor Details
#initialize(resource) ⇒ Authorizer
Returns a new instance of Authorizer.
13 14 15 |
# File 'lib/authority/authorizer.rb', line 13 def initialize(resource) @resource = resource end |
Instance Attribute Details
#resource ⇒ Object (readonly)
The base Authorizer class, from which all the authorizers in an app will descend. Provides the authorizer with both class and instance methods like ‘updatable_by?(user)`. Exactly which methods get defined is determined from `config.abilities`; the class is evaluated after any user-supplied config block is run in order to make that possible.
11 12 13 |
# File 'lib/authority/authorizer.rb', line 11 def resource @resource end |
Class Method Details
.default(adjective, user) ⇒ Object
35 36 37 |
# File 'lib/authority/authorizer.rb', line 35 def self.default(adjective, user) Authority.configuration.default_strategy.call(adjective, self, user) end |