Class: PEClient::Resource::RBACV1::Groups
- Defined in:
- lib/pe_client/resources/rbac.v1/groups.rb
Overview
User groups allow you to quickly assign one or more roles to a set of users by placing all relevant users in the group. This is more efficient than assigning roles to each user individually. Use the groups endpoints to get lists of groups and add, delete, and change groups.
Constant Summary collapse
- BASE_PATH =
The base path for RBAC API v1 Groups endpoints.
"#{RBACV1::BASE_PATH}/groups".freeze
- COMMAND_BASE_PATH =
The base path for RBAC API v1 Groups command endpoints.
"#{RBACV1::BASE_PATH}/command/groups".freeze
Instance Method Summary collapse
-
#create(login:, role_ids:, identity_provider_id:, display_name: nil) ⇒ Hash
Create a remote directory user group.
-
#create_deprecated(login, role_ids) ⇒ Hash
deprecated
Deprecated.
Use #create instead.
-
#delete(sid) ⇒ Hash
Deletes the user group with the specified ID from PE RBAC.
-
#edit(sid, attributes) ⇒ Hash
Edit the content of the specified user group object.
-
#get(sid = nil) ⇒ Hash
Fetch information about all user groups.
Methods inherited from Base
Constructor Details
This class inherits a constructor from PEClient::Resource::Base
Instance Method Details
#create(login:, role_ids:, identity_provider_id:, display_name: nil) ⇒ Hash
Create a remote directory user group.
55 56 57 |
# File 'lib/pe_client/resources/rbac.v1/groups.rb', line 55 def create(login:, role_ids:, identity_provider_id:, display_name: nil) @client.post COMMAND_BASE_PATH, body: {login:, role_ids:, identity_provider_id:, display_name:}.compact end |
#create_deprecated(login, role_ids) ⇒ Hash
Use #create instead.
Creates a new remote directory user group.
90 91 92 93 |
# File 'lib/pe_client/resources/rbac.v1/groups.rb', line 90 def create_deprecated(login, role_ids) PEClient.deprecated "create_deprecated", "create" @client.post COMMAND_BASE_PATH, body: {login:, role_ids:} end |
#delete(sid) ⇒ Hash
Deletes the user group with the specified ID from PE RBAC. This endpoint does not change the directory service.
77 78 79 |
# File 'lib/pe_client/resources/rbac.v1/groups.rb', line 77 def delete(sid) @client.delete "#{BASE_PATH}/#{sid}" end |
#edit(sid, attributes) ⇒ Hash
Edit the content of the specified user group object. For example, you can update the group’s roles or membership.
67 68 69 |
# File 'lib/pe_client/resources/rbac.v1/groups.rb', line 67 def edit(sid, attributes) @client.put "#{BASE_PATH}/#{sid}", body: attributes end |