Class: Conjur::Group
- Inherits:
-
RestClient::Resource
- Object
- RestClient::Resource
- Conjur::Group
- Includes:
- ActsAsAsset, ActsAsRole
- Defined in:
- lib/conjur/group.rb
Overview
A Conjur Group represents a collection of Conjur Users. This class represents Conjur group assets and operations on them.
You should not create instances of this class directly. Instead, you can get them from API methods like API#group and API#groups.
Instance Method Summary collapse
-
#add_member(member, options = {})
Add a user to the group or change whether an existing member can manage other members.
-
#remove_member(member)
Remove a member from this group.
-
#update(props)
Update group properties.
Methods included from ActsAsRole
#can, #cannot, #role, #role_kind, #roleid
Methods included from HasAttributes
#attributes, #invalidate, #refresh, #save, #to_json
Methods included from ActsAsResource
#deny, #permit, #resource, #resource_kind, #resourceid
Methods included from HasOwner
Methods included from Exists
Methods included from HasId
Instance Method Details
#add_member(member, options = {})
This method returns an undefined value.
Add a user to the group or change whether an existing member can manage other members.
54 55 56 |
# File 'lib/conjur/group.rb', line 54 def add_member(member, = {}) role.grant_to member, end |
#remove_member(member)
This method returns an undefined value.
Remove a member from this group.
Notes
- Unlike #add_member, this method is not idempotent.
This means that calling it twice with the same user will raise a
RestClient::ResourceNotFound
exception. - The member may be represented as a qualified conjur id or a User instance. Although
it will accept anything that responds to
#roleid
, the behavior when adding or removing a non-user role is undefined.
77 78 79 |
# File 'lib/conjur/group.rb', line 77 def remove_member(member) role.revoke_from member end |
#update(props)
This method returns an undefined value.
Update group properties. Currently the only supported property is :gidnumber
.
86 87 88 89 |
# File 'lib/conjur/group.rb', line 86 def update props # not an alias because doc put props end |