LIST ROLES
Lists roles and shows superuser and login status.
Roles have DESCRIBE
permission on their own and any inherited roles.
Only roles that the current user has permission to see are listed.
Superusers can see all roles.
This command runs with a consistency level of QUORUM
.
SynSyntaxopsis
LIST ROLES [ OF <role_name> ] [ NORECURSIVE ] ;
Syntax legend
Syntax conventions | Description |
---|---|
UPPERCASE |
Literal keyword. |
Lowercase |
Not literal. |
|
Variable value. Replace with a user-defined value. |
|
Optional.
Square brackets ( |
|
Group.
Parentheses ( |
|
Or.
A vertical bar ( |
|
Repeatable.
An ellipsis ( |
|
Single quotation ( |
|
Map collection.
Braces ( |
Set, list, map, or tuple.
Angle brackets ( |
|
|
End CQL statement.
A semicolon ( |
|
Separate the command line options from the command arguments with two hyphens ( |
|
Search CQL only: Single quotation marks ( |
|
Search CQL only: Identify the entity and literal value to overwrite the XML element in the schema and solrConfig files. |
Parameters
Parameter | Description | Default |
---|---|---|
|
Identifier of the role. CQL forces all names to lowercase. If you need to preserve case or use special characters in the role name, enclose <role_name> in quotes. |
|
|
Do not show inherited roles. |
Examples
List roles assigned to a role
Show the roles for a particular role. Sufficient privileges are required to show this information. Superusers can see all roles.
LIST ROLES OF coach;
Results
WARNING: cqlsh was built against 5.0-beta1, but this server is 5.0. All features may not work!
role | super | login | options | datacenters
-------+-------+-------+---------+-------------
coach | False | True | {} | ALL
(1 rows)
List roles assigned to a role without showing inherited roles
Show the roles for a particular role without showing inherited roles.
The NORECURSIVE
option is used to show only the roles directly assigned to the role.
Sufficient privileges are required to show this information.
Superusers can see all roles.
Check all the roles assigned to the sandy
role:
LIST ROLES OF sandy;
Results
WARNING: cqlsh was built against 5.0-beta1, but this server is 5.0. All features may not work!
role | super | login | options | datacenters
--------------+-------+-------+---------+-------------
sandy | True | True | {} | ALL
sys_admin | True | True | {} | ALL
team_manager | False | True | {} | ALL
(3 rows)
Now check all the roles assigned to the sandy
role without showing inherited roles:
LIST ROLES OF sandy NORECURSIVE;
Results
WARNING: cqlsh was built against 5.0-beta1, but this server is 5.0. All features may not work!
role | super | login | options | datacenters
--------------+-------+-------+---------+-------------
sandy | True | True | {} | ALL
team_manager | False | True | {} | ALL
(2 rows)