Class: Soar::Authentication::Identity::Provider::Staff

Inherits:
Object
  • Object
show all
Defined in:
lib/soar/authentication/identity/provider/staff.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(directory: nil, authenticated_identifier: nil) ⇒ Staff

Returns a new instance of Staff.



11
12
13
14
15
16
# File 'lib/soar/authentication/identity/provider/staff.rb', line 11

def initialize(directory: nil, authenticated_identifier: nil)
  @directory = directory
  @authenticated_identifier = authenticated_identifier
  identity_provider = Soar::Registry::Identity::Provider::Staff::Email.new(directory: @directory)
  @identity_registry = Soar::Registry::Identity.new(identity_provider)
end

Instance Attribute Details

#directoryObject (readonly)

Returns the value of attribute directory.



9
10
11
# File 'lib/soar/authentication/identity/provider/staff.rb', line 9

def directory
  @directory
end

Instance Method Details

#roleObject



24
25
26
# File 'lib/soar/authentication/identity/provider/staff.rb', line 24

def role
  "staff"
end

#uuidObject



18
19
20
21
22
# File 'lib/soar/authentication/identity/provider/staff.rb', line 18

def uuid
  attributes = @identity_registry.get_attributes(@authenticated_identifier)
  primary_key = @directory.index[0]
  attributes[primary_key]
end