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
role | super | login | options
-------+-------+-------+---------
coach | False | True | {}
(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
role | super | login | options
--------------+-------+-------+---------
sandy | True | True | {}
sys_admin | True | True | {}
team_manager | False | True | {}
(3 rows)
Now check all the roles assigned to the sandy
role without showing inherited roles:
LIST ROLES OF sandy NORECURSIVE;
Results
role | super | login | options
--------------+-------+-------+---------
sandy | True | True | {}
team_manager | False | True | {}
(2 rows)