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.
9 10 11 12 |
# File 'lib/jsonapi/authorization/configuration.rb', line 9 def initialize self. = ::JSONAPI::Authorization::DefaultPunditAuthorizer self.pundit_user = :user end |
Instance Attribute Details
#authorizer ⇒ Object
Returns the value of attribute authorizer.
6 7 8 |
# File 'lib/jsonapi/authorization/configuration.rb', line 6 def @authorizer end |
#pundit_user ⇒ Object
Returns the value of attribute pundit_user.
7 8 9 |
# File 'lib/jsonapi/authorization/configuration.rb', line 7 def pundit_user @pundit_user end |
Instance Method Details
#user_context(context) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/jsonapi/authorization/configuration.rb', line 14 def user_context(context) if pundit_user.is_a?(Symbol) context[pundit_user] else pundit_user.call(context) end end |