The GRANT statement allows granting any RBAC roles to a specific user.
|simple||Roles which apply generically to all buckets/resources in the cluster.
For example: ClusterAdmin or BucketAdmin
|parameterized by a bucket||Roles which are defined for the scope of the specified bucket only. The bucket name is specified after ON.
For example: BucketReader ON `travel-sample`
or Query_Select ON `travel-sample`
GRANT role1 [, role2, ...] ON bucket1 [, bucket2, ...] TO user1 [, user2, ...];
- RBAC-role is one of the RBAC role names predefined by Couchbase Server.
- RBAC-user is the user name created by the Couchbase Server RBAC system.
The following roles have short forms that can be used as well:
- query_select → select
- query_insert → insert
- query_update → update
- query_delete → delete
- The name of your Couchbase or Memcached bucket or buckets.
- RBAC-user in your bucket.
GRANT Replication Admin, Query External Access TO cchaplan, jgleason; GRANT replication_admin, query_external_access TO cchaplan, jgleason;
GRANT Query Select, Views Admin ON orders, customers TO bill, linda; GRANT query_select, views_admin ON orders, customers TO bill, linda;
Example 1: Grant the role of Cluster Administrator to three people.
GRANT ClusterAdmin TO david, michael, robin;
GRANT ClusterAdmin, BucketReader ON `travel-sample` TO debby;