Restricting Access to Data
The RESTRICT command denies permission on a resource to the role.
The user is denied access even if the privilege has been granted directly to the role or if it was inherited.
|
However, regardless of how you use |
Use UNRESTRICT to remove any restrictions the role has on the database resource.
|
|
-
Log in to
CQLSHwith asuperuserrole.cqlsh -u <username>Logging in with the default role
cassandramay impact performance or fail. All requests including login are executed with consistencyQUORUM. -
Create an account with login enabled, but do not give this
db_adminaccount thesuperuserrole.CREATE ROLE IF NOT EXISTS db_admin WITH superuser = false AND login = true AND password = 'anypasswordwilldo';A password is required for internal accounts but not for LDAP or Kerberos.
-
Restrict the role from accessing the data in the cycling keyspace:
RESTRICT TRUNCATE, UPDATE, SELECT ON KEYSPACE cycling TO db_admin; -
Verify the restriction:
SELECT role, resource, restricted FROM system_auth.role_permissions WHERE role = 'db_admin';The results show the permissions denied to the role.
role | resource | restricted ----------+--------------+---------------------- db_admin | data/cycling | {'MODIFY', 'SELECT'} (1 rows)