Class: NexusCqrs::Auth::UserContext
- Inherits:
-
Object
- Object
- NexusCqrs::Auth::UserContext
- Defined in:
- lib/nexus_cqrs/auth/user_context.rb
Overview
Class used to provide additional context into pundit. This enables us to not only pass the user model, but also the global permissions for that user - as those are pulled from the user’s request, not the model.
Instance Attribute Summary collapse
-
#global_permissions ⇒ Object
readonly
Returns the value of attribute global_permissions.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(user, global_permissions) ⇒ UserContext
constructor
A new instance of UserContext.
Constructor Details
#initialize(user, global_permissions) ⇒ UserContext
Returns a new instance of UserContext.
9 10 11 12 |
# File 'lib/nexus_cqrs/auth/user_context.rb', line 9 def initialize(user, ) @user = user @global_permissions = end |
Instance Attribute Details
#global_permissions ⇒ Object (readonly)
Returns the value of attribute global_permissions.
7 8 9 |
# File 'lib/nexus_cqrs/auth/user_context.rb', line 7 def @global_permissions end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
7 8 9 |
# File 'lib/nexus_cqrs/auth/user_context.rb', line 7 def user @user end |