Class: JSONAPI::Authorization::Configuration
- Inherits:
-
Object
- Object
- JSONAPI::Authorization::Configuration
- Defined in:
- lib/jsonapi/authorization/configuration.rb
Instance Attribute Summary collapse
-
#authorizer ⇒ Object
Returns the value of attribute authorizer.
-
#pundit_user ⇒ Object
Returns the value of attribute pundit_user.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #user_context(context) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
10 11 12 13 |
# File 'lib/jsonapi/authorization/configuration.rb', line 10 def initialize self. = ::JSONAPI::Authorization::DefaultPunditAuthorizer self.pundit_user = :user end |
Instance Attribute Details
#authorizer ⇒ Object
Returns the value of attribute authorizer.
8 9 10 |
# File 'lib/jsonapi/authorization/configuration.rb', line 8 def @authorizer end |
#pundit_user ⇒ Object
Returns the value of attribute pundit_user.
8 9 10 |
# File 'lib/jsonapi/authorization/configuration.rb', line 8 def pundit_user @pundit_user end |
Instance Method Details
#user_context(context) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/jsonapi/authorization/configuration.rb', line 15 def user_context(context) if pundit_user.is_a?(Symbol) context[pundit_user] else pundit_user.call(context) end end |