Class: Conjur::RoleGrant
- Inherits:
-
Object
- Object
- Conjur::RoleGrant
- Extended by:
- BuildObject::ClassMethods, Cast
- Defined in:
- lib/conjur/role_grant.rb
Overview
Represents the membership of a role. RoleGrant
s are returned
by ActsAsRole#members and represent members of the role on which the method was invoked.
Instance Attribute Summary collapse
-
#admin_option ⇒ Boolean
readonly
When true, the role #member is allowed to give this grant to other roles.
-
#member ⇒ Conjur::Role
readonly
The member role in the relationship.
-
#role ⇒ Conjur::Role
readonly
The role which was granted.
Instance Method Summary collapse
- #as_json(options = {}) ⇒ Object
-
#to_h ⇒ Object
Representation of the role grant as a hash.
- #to_s ⇒ Object
Methods included from BuildObject::ClassMethods
Instance Attribute Details
#admin_option ⇒ Boolean (readonly)
When true, the role #member is allowed to give this grant to other roles
44 45 46 |
# File 'lib/conjur/role_grant.rb', line 44 def admin_option @admin_option end |
#member ⇒ Conjur::Role (readonly)
The member role in the relationship
39 40 41 |
# File 'lib/conjur/role_grant.rb', line 39 def member @member end |
#role ⇒ Conjur::Role (readonly)
The role which was granted.
35 36 37 |
# File 'lib/conjur/role_grant.rb', line 35 def role @role end |
Instance Method Details
#as_json(options = {}) ⇒ Object
71 72 73 |
# File 'lib/conjur/role_grant.rb', line 71 def as_json = {} to_h.as_json() end |
#to_h ⇒ Object
Representation of the role grant as a hash.
59 60 61 62 63 64 65 |
# File 'lib/conjur/role_grant.rb', line 59 def to_h { role: role.id, member: member.id, admin_option: admin_option } end |
#to_s ⇒ Object
67 68 69 |
# File 'lib/conjur/role_grant.rb', line 67 def to_s to_h.to_s end |