Class: SDM::User
- Inherits:
-
Object
- Object
- SDM::User
- Defined in:
- lib/models/porcelain.rb
Overview
A User can connect to resources they are granted directly, or granted via roles.
Instance Attribute Summary collapse
-
#email ⇒ Object
The User's email address.
-
#external_id ⇒ Object
External ID is an alternative unique ID this user is represented by within an external service.
-
#first_name ⇒ Object
The User's first name.
-
#id ⇒ Object
Unique identifier of the User.
-
#last_name ⇒ Object
The User's last name.
-
#managed_by ⇒ Object
Managed By is a read only field for what service manages this user, e.g.
-
#permission_level ⇒ Object
PermissionLevel is the user's permission level e.g.
-
#suspended ⇒ Object
Suspended is a read only field for the User's suspended state.
-
#tags ⇒ Object
Tags is a map of key, value pairs.
Instance Method Summary collapse
-
#initialize(email: nil, external_id: nil, first_name: nil, id: nil, last_name: nil, managed_by: nil, permission_level: nil, suspended: nil, tags: nil) ⇒ User
constructor
A new instance of User.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(email: nil, external_id: nil, first_name: nil, id: nil, last_name: nil, managed_by: nil, permission_level: nil, suspended: nil, tags: nil) ⇒ User
Returns a new instance of User.
11439 11440 11441 11442 11443 11444 11445 11446 11447 11448 11449 11450 11451 11452 11453 11454 11455 11456 11457 11458 11459 |
# File 'lib/models/porcelain.rb', line 11439 def initialize( email: nil, external_id: nil, first_name: nil, id: nil, last_name: nil, managed_by: nil, permission_level: nil, suspended: nil, tags: nil ) @email = email == nil ? "" : email @external_id = external_id == nil ? "" : external_id @first_name = first_name == nil ? "" : first_name @id = id == nil ? "" : id @last_name = last_name == nil ? "" : last_name @managed_by = managed_by == nil ? "" : managed_by @permission_level = == nil ? "" : @suspended = suspended == nil ? false : suspended @tags = == nil ? SDM::() : end |
Instance Attribute Details
#email ⇒ Object
The User's email address. Must be unique.
11421 11422 11423 |
# File 'lib/models/porcelain.rb', line 11421 def email @email end |
#external_id ⇒ Object
External ID is an alternative unique ID this user is represented by within an external service.
11423 11424 11425 |
# File 'lib/models/porcelain.rb', line 11423 def external_id @external_id end |
#first_name ⇒ Object
The User's first name.
11425 11426 11427 |
# File 'lib/models/porcelain.rb', line 11425 def first_name @first_name end |
#id ⇒ Object
Unique identifier of the User.
11427 11428 11429 |
# File 'lib/models/porcelain.rb', line 11427 def id @id end |
#last_name ⇒ Object
The User's last name.
11429 11430 11431 |
# File 'lib/models/porcelain.rb', line 11429 def last_name @last_name end |
#managed_by ⇒ Object
Managed By is a read only field for what service manages this user, e.g. StrongDM, Okta, Azure.
11431 11432 11433 |
# File 'lib/models/porcelain.rb', line 11431 def managed_by @managed_by end |
#permission_level ⇒ Object
PermissionLevel is the user's permission level e.g. admin, DBA, user.
11433 11434 11435 |
# File 'lib/models/porcelain.rb', line 11433 def @permission_level end |
#suspended ⇒ Object
Suspended is a read only field for the User's suspended state.
11435 11436 11437 |
# File 'lib/models/porcelain.rb', line 11435 def suspended @suspended end |
#tags ⇒ Object
Tags is a map of key, value pairs.
11437 11438 11439 |
# File 'lib/models/porcelain.rb', line 11437 def @tags end |
Instance Method Details
#to_json(options = {}) ⇒ Object
11461 11462 11463 11464 11465 11466 11467 |
# File 'lib/models/porcelain.rb', line 11461 def to_json( = {}) hash = {} self.instance_variables.each do |var| hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var end hash.to_json end |