Class: Rbac::User

Inherits:
Object
  • Object
show all
Defined in:
lib/rbac/user.rb

Overview

Class Rbac::User describes authorized user and stores its attributes required for RBAC filtration

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(role:, **attrs) ⇒ User

Returns a new instance of User.



13
14
15
16
# File 'lib/rbac/user.rb', line 13

def initialize(role:, **attrs)
  @role = role
  @attributes = attrs.stringify_keys
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



9
10
11
# File 'lib/rbac/user.rb', line 9

def attributes
  @attributes
end

#roleObject (readonly)

Returns the value of attribute role.



9
10
11
# File 'lib/rbac/user.rb', line 9

def role
  @role
end