admin-role-manage

admin-role-manage

Sets access control roles for users.

Syntax

The basic syntax is:

couchbase-cli admin-role-manage -c [host]:8091 -u [admin] -p [password] [options]

Description

Use this command to set access control roles for administrators.

Options

The following are the command options:

Table 1. external-authentication options
Options Description
--my-roles Returns a list of roles for the current user.
--get-roles Returns a list of users and roles.
--set-users A comma-delimited list of user IDs for which the access-control roles are set.
--set-names An optional quoted, comma-delimited list of names, one for each of the specified user IDs.
--roles A comma-delimited list of roles to set for users, one or more from admin, ro-admin, cluster-admin, replication-admin, bucket-admin [bucket name or '*'], and views-admin[bucket name or '*'].
--delete-users A comma-delimited list of users to remove from the access control.

Examples

Show the current users roles
couchbase-cli admin-role-manage -c 192.168.0.1:8091 -u Administrator -p password --my-roles
Get a list of all users and roles
couchbase-cli admin-role-manage -c 192.168.0.1:8091 -u Administrator -p password --get-roles
Make Bob and Mary cluster_admins and bucket admins for the default bucket
couchbase-cli admin-role-manage -c 192.168.0.1:8091 -u Administrator -p password  \
   --set-users=bob,mary --set-names="Bob Smith, Mary Jones" --roles=cluster_admin,bucket_admin[default]
Make Jen to be the bucket adminstrator for all buckets
couchbase-cli admin-role-manage -c 192.168.0.1:8091 -u Administrator -p password  \
   --set-users=jen --roles=bucket_admin[*]
Remove all roles for Bob
couchbase-cli admin-role-manage -c 192.168.0.1:8091 -u Administrator -p password  --delete-users=bob