REVOKE ROLE
Removes the privileges of one role from another role. The role that is being revoked must have been granted to the role by another role. Privilege removal is immediate, even to active client sessions.
See REVOKE PERMISSION to revoke permission to resources from a role.
Syntax
REVOKE <role_name> FROM <role_name> ;
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. |
Example
Manage permissions using GRANT and REVOKE.
+
|
A role can only modify permissions of another role and can only modify ( |
The role coach can no longer perform queries or modify data in the cycling keyspace.
REVOKE cycling_admin FROM coach;
-
View the coach’s permissions, to see that
coachnow has lost thecycling_adminpermissions.LIST ALL PERMISSIONS OF coach;Results
role | resource | permissions ------+----------+------------- (0 rows)
Because of inheritance in this example, the user can perform SELECT queries on the table if one of these conditions is met:
-
The user is a superuser.
-
The user has
SELECTonALL KEYSPACESpermissions. -
The user has
SELECTon the cycling keyspace.
The role coach can no longer perform ALTER commands in the cycling keyspace:
# REVOKE ALTER ON KEYSPACE cycling FROM coach;