Class: AdminSuite::Auth::Strategy
- Inherits:
-
Object
- Object
- AdminSuite::Auth::Strategy
- Defined in:
- lib/admin_suite/auth/strategy.rb
Overview
Base class for authentication strategies.
A strategy authenticates the current request. It must either:
- return a truthy actor object (request allowed), or
- deny: render/redirect on the controller itself (halts the chain), or return nil/false (the engine responds 403).
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#authenticate!(controller) ⇒ Object?
The authenticated actor, or nil when denied.
-
#initialize(options = {}) ⇒ Strategy
constructor
A new instance of Strategy.
Constructor Details
#initialize(options = {}) ⇒ Strategy
Returns a new instance of Strategy.
14 15 16 |
# File 'lib/admin_suite/auth/strategy.rb', line 14 def initialize( = {}) @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
12 13 14 |
# File 'lib/admin_suite/auth/strategy.rb', line 12 def @options end |
Instance Method Details
#authenticate!(controller) ⇒ Object?
Returns the authenticated actor, or nil when denied.
20 21 22 |
# File 'lib/admin_suite/auth/strategy.rb', line 20 def authenticate!(controller) raise NotImplementedError, "#{self.class.name} must implement #authenticate!(controller)" end |