Class: SDM::RoleGrant

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

Overview

A RoleGrant connects a resource to a role, granting members of the role access to that resource.

Deprecated: use Role access rules instead.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id: nil, resource_id: nil, role_id: nil) ⇒ RoleGrant

Returns a new instance of RoleGrant.



5008
5009
5010
5011
5012
5013
5014
5015
5016
# File 'lib/models/porcelain.rb', line 5008

def initialize(
  id: nil,
  resource_id: nil,
  role_id: nil
)
  @id = id == nil ? "" : id
  @resource_id = resource_id == nil ? "" : resource_id
  @role_id = role_id == nil ? "" : role_id
end

Instance Attribute Details

#idObject

Unique identifier of the RoleGrant.



5002
5003
5004
# File 'lib/models/porcelain.rb', line 5002

def id
  @id
end

#resource_idObject

The id of the resource of this RoleGrant.



5004
5005
5006
# File 'lib/models/porcelain.rb', line 5004

def resource_id
  @resource_id
end

#role_idObject

The id of the attached role of this RoleGrant.



5006
5007
5008
# File 'lib/models/porcelain.rb', line 5006

def role_id
  @role_id
end

Instance Method Details

#to_json(options = {}) ⇒ Object



5018
5019
5020
5021
5022
5023
5024
# File 'lib/models/porcelain.rb', line 5018

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