Class: SDM::RoleGrant
- Inherits:
-
Object
- Object
- SDM::RoleGrant
- Defined in:
- lib/models/porcelain.rb
Overview
A RoleGrant connects a resource to a role, granting members of the role access to that resource.
Instance Attribute Summary collapse
-
#id ⇒ Object
Unique identifier of the RoleGrant.
-
#resource_id ⇒ Object
The id of the resource of this RoleGrant.
-
#role_id ⇒ Object
The id of the attached role of this RoleGrant.
Instance Method Summary collapse
-
#initialize(id: nil, resource_id: nil, role_id: nil) ⇒ RoleGrant
constructor
A new instance of RoleGrant.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(id: nil, resource_id: nil, role_id: nil) ⇒ RoleGrant
Returns a new instance of RoleGrant.
4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 |
# File 'lib/models/porcelain.rb', line 4842 def initialize( id: nil, resource_id: nil, role_id: nil ) if id != nil @id = id end if resource_id != nil @resource_id = resource_id end if role_id != nil @role_id = role_id end end |
Instance Attribute Details
#id ⇒ Object
Unique identifier of the RoleGrant.
4836 4837 4838 |
# File 'lib/models/porcelain.rb', line 4836 def id @id end |
#resource_id ⇒ Object
The id of the resource of this RoleGrant.
4838 4839 4840 |
# File 'lib/models/porcelain.rb', line 4838 def resource_id @resource_id end |
#role_id ⇒ Object
The id of the attached role of this RoleGrant.
4840 4841 4842 |
# File 'lib/models/porcelain.rb', line 4840 def role_id @role_id end |
Instance Method Details
#to_json(options = {}) ⇒ Object
4858 4859 4860 4861 4862 4863 4864 |
# File 'lib/models/porcelain.rb', line 4858 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 |