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.
11129 11130 11131 11132 11133 11134 11135 11136 11137 11138 11139 11140 11141 11142 11143 11144 11145 11146 11147 11148 11149 |
# File 'lib/models/porcelain.rb', line 11129 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 = == nil ? "" : @suspended = suspended == nil ? false : suspended = == nil ? SDM::() : end |
Instance Attribute Details
#email ⇒ Object
The User's email address. Must be unique.
11111 11112 11113 |
# File 'lib/models/porcelain.rb', line 11111 def email @email end |
#external_id ⇒ Object
External ID is an alternative unique ID this user is represented by within an external service.
11113 11114 11115 |
# File 'lib/models/porcelain.rb', line 11113 def external_id @external_id end |
#first_name ⇒ Object
The User's first name.
11115 11116 11117 |
# File 'lib/models/porcelain.rb', line 11115 def first_name @first_name end |
#id ⇒ Object
Unique identifier of the User.
11117 11118 11119 |
# File 'lib/models/porcelain.rb', line 11117 def id @id end |
#last_name ⇒ Object
The User's last name.
11119 11120 11121 |
# File 'lib/models/porcelain.rb', line 11119 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.
11121 11122 11123 |
# File 'lib/models/porcelain.rb', line 11121 def managed_by @managed_by end |
#permission_level ⇒ Object
PermissionLevel is the user's permission level e.g. admin, DBA, user.
11123 11124 11125 |
# File 'lib/models/porcelain.rb', line 11123 def end |
#suspended ⇒ Object
Suspended is a read only field for the User's suspended state.
11125 11126 11127 |
# File 'lib/models/porcelain.rb', line 11125 def suspended @suspended end |
#tags ⇒ Object
Tags is a map of key, value pairs.
11127 11128 11129 |
# File 'lib/models/porcelain.rb', line 11127 def end |
Instance Method Details
#to_json(options = {}) ⇒ Object
11151 11152 11153 11154 11155 11156 11157 |
# File 'lib/models/porcelain.rb', line 11151 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 |