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 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 all roles
-
Show all the roles that the current role has permission to describe.
LIST ROLES; - 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;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
NORECURSIVEoption 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
sandyrole:LIST ROLES OF sandy;role | super | login | options | datacenters --------------+-------+-------+---------+------------- sandy | True | True | {} | ALL sys_admin | True | True | {} | ALL team_manager | False | True | {} | ALL (3 rows)Check all the roles assigned to the
sandyrole without showing inherited roles:LIST ROLES OF sandy NORECURSIVE;role | super | login | options | datacenters --------------+-------+-------+---------+------------- sandy | True | True | {} | ALL team_manager | False | True | {} | ALL (2 rows)