Class: SDM::Role

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

Overview

A Role is a collection of permissions, and typically corresponds to a team, Active Directory OU, or other organizational unit. Users are granted access to resources by assigning them to roles.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id: nil, name: nil, composite: nil) ⇒ Role

Returns a new instance of Role.



4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
# File 'lib/models/porcelain.rb', line 4932

def initialize(
	id:nil \
,
	name:nil \
,
	composite:nil \
)
	if id != nil
		@id = id
	end
	if name != nil
		@name = name
	end
	if composite != nil
		@composite = composite
	end
end

Instance Attribute Details

#compositeObject

True if the Role is a composite role.



4931
4932
4933
# File 'lib/models/porcelain.rb', line 4931

def composite
  @composite
end

#idObject

Unique identifier of the Role.



4927
4928
4929
# File 'lib/models/porcelain.rb', line 4927

def id
  @id
end

#nameObject

Unique human-readable name of the Role.



4929
4930
4931
# File 'lib/models/porcelain.rb', line 4929

def name
  @name
end

Instance Method Details

#to_json(options = {}) ⇒ Object



4949
4950
4951
4952
4953
4954
4955
# File 'lib/models/porcelain.rb', line 4949

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