Class: Authority::Authorizer
- Inherits:
-
Object
- Object
- Authority::Authorizer
- Extended by:
- Forwardable
- Defined in:
- lib/authority/authorizer.rb
Direct Known Subclasses
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
-
.default(adjective, user, options = {}) ⇒ Object
Whitelisting approach: anything not specified will be forbidden.
Instance Method Summary collapse
-
#initialize(resource) ⇒ Authorizer
constructor
A new instance of Authorizer.
Constructor Details
#initialize(resource) ⇒ Authorizer
Returns a new instance of Authorizer.
14 15 16 |
# File 'lib/authority/authorizer.rb', line 14 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.
12 13 14 |
# File 'lib/authority/authorizer.rb', line 12 def resource @resource end |
Class Method Details
.default(adjective, user, options = {}) ⇒ Object
Whitelisting approach: anything not specified will be forbidden
19 20 21 |
# File 'lib/authority/authorizer.rb', line 19 def self.default(adjective, user, = {}) false end |