Class: SDM::Role

Inherits:
Object
  • Object
show all
Defined in:
lib/models/porcelain.rb

Overview

A Role has a list of access rules which determine which Resources the members of the Role have access to. An Account can be a member of multiple Roles via AccountAttachments.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(access_rules: nil, id: nil, managed_by: nil, name: nil, tags: nil) ⇒ Role

Returns a new instance of Role.



16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
# File 'lib/models/porcelain.rb', line 16141

def initialize(
  access_rules: nil,
  id: nil,
  managed_by: nil,
  name: nil,
  tags: nil
)
  @access_rules = access_rules == nil ? SDM::_porcelain_zero_value_access_rules() : access_rules
  @id = id == nil ? "" : id
  @managed_by = managed_by == nil ? "" : managed_by
  @name = name == nil ? "" : name
  @tags = tags == nil ? SDM::_porcelain_zero_value_tags() : tags
end

Instance Attribute Details

#access_rulesObject

AccessRules is a list of access rules defining the resources this Role has access to.



16131
16132
16133
# File 'lib/models/porcelain.rb', line 16131

def access_rules
  @access_rules
end

#idObject

Unique identifier of the Role.



16133
16134
16135
# File 'lib/models/porcelain.rb', line 16133

def id
  @id
end

#managed_byObject

Managed By is a read only field for what service manages this role, e.g. StrongDM, Okta, Azure.



16135
16136
16137
# File 'lib/models/porcelain.rb', line 16135

def managed_by
  @managed_by
end

#nameObject

Unique human-readable name of the Role.



16137
16138
16139
# File 'lib/models/porcelain.rb', line 16137

def name
  @name
end

#tagsObject

Tags is a map of key, value pairs.



16139
16140
16141
# File 'lib/models/porcelain.rb', line 16139

def tags
  @tags
end

Instance Method Details

#to_json(options = {}) ⇒ Object



16155
16156
16157
16158
16159
16160
16161
# File 'lib/models/porcelain.rb', line 16155

def to_json(options = {})
  hash = {}
  self.instance_variables.each do |var|
    hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var
  end
  hash.to_json
end