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.
-
#password ⇒ Object
Password is a write-only field that can be used to set the user's password.
-
#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, password: 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, password: nil, permission_level: nil, suspended: nil, tags: nil) ⇒ User
Returns a new instance of User.
12124 12125 12126 12127 12128 12129 12130 12131 12132 12133 12134 12135 12136 12137 12138 12139 12140 12141 12142 12143 12144 12145 12146 |
# File 'lib/models/porcelain.rb', line 12124 def initialize( email: nil, external_id: nil, first_name: nil, id: nil, last_name: nil, managed_by: nil, password: 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 @password = password == nil ? "" : password = == nil ? "" : @suspended = suspended == nil ? false : suspended = == nil ? SDM::() : end |
Instance Attribute Details
#email ⇒ Object
The User's email address. Must be unique.
12103 12104 12105 |
# File 'lib/models/porcelain.rb', line 12103 def email @email end |
#external_id ⇒ Object
External ID is an alternative unique ID this user is represented by within an external service.
12105 12106 12107 |
# File 'lib/models/porcelain.rb', line 12105 def external_id @external_id end |
#first_name ⇒ Object
The User's first name.
12107 12108 12109 |
# File 'lib/models/porcelain.rb', line 12107 def first_name @first_name end |
#id ⇒ Object
Unique identifier of the User.
12109 12110 12111 |
# File 'lib/models/porcelain.rb', line 12109 def id @id end |
#last_name ⇒ Object
The User's last name.
12111 12112 12113 |
# File 'lib/models/porcelain.rb', line 12111 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.
12113 12114 12115 |
# File 'lib/models/porcelain.rb', line 12113 def managed_by @managed_by end |
#password ⇒ Object
Password is a write-only field that can be used to set the user's password. Currently only supported for update.
12116 12117 12118 |
# File 'lib/models/porcelain.rb', line 12116 def password @password end |
#permission_level ⇒ Object
PermissionLevel is the user's permission level e.g. admin, DBA, user.
12118 12119 12120 |
# File 'lib/models/porcelain.rb', line 12118 def end |
#suspended ⇒ Object
Suspended is a read only field for the User's suspended state.
12120 12121 12122 |
# File 'lib/models/porcelain.rb', line 12120 def suspended @suspended end |
#tags ⇒ Object
Tags is a map of key, value pairs.
12122 12123 12124 |
# File 'lib/models/porcelain.rb', line 12122 def end |
Instance Method Details
#to_json(options = {}) ⇒ Object
12148 12149 12150 12151 12152 12153 12154 |
# File 'lib/models/porcelain.rb', line 12148 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 |