Class: Conjur::RoleGrant

Inherits:
Struct
  • Object
show all
Defined in:
lib/conjur/role_grant.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#admin_optionObject

Returns the value of attribute admin_option

Returns:

  • (Object)

    the current value of admin_option



22
23
24
# File 'lib/conjur/role_grant.rb', line 22

def admin_option
  @admin_option
end

#grantorObject

Returns the value of attribute grantor

Returns:

  • (Object)

    the current value of grantor



22
23
24
# File 'lib/conjur/role_grant.rb', line 22

def grantor
  @grantor
end

#memberObject

Returns the value of attribute member

Returns:

  • (Object)

    the current value of member



22
23
24
# File 'lib/conjur/role_grant.rb', line 22

def member
  @member
end

Class Method Details

.parse_from_json(json, credentials) ⇒ Object



24
25
26
27
28
# File 'lib/conjur/role_grant.rb', line 24

def parse_from_json(json, credentials)
  member = Role.new(Conjur::Authz::API.host, credentials)[Conjur::API.parse_role_id(json['member']).join('/')]
  grantor = Role.new(Conjur::Authz::API.host, credentials)[Conjur::API.parse_role_id(json['grantor']).join('/')]
  RoleGrant.new(member, grantor, json['admin_option'])
end