Data Resources
Data resources are keyspaces, types, table, and rows. Access is controlled using modelled hierarchy. Granting and revoking a privilege on a top-level object automatically allows the same permission on all ancestors.
Data resources have the following hierarchy:
Synopsis
Use the following syntax for data resource access control:
-
GRANT <permission>[, <permission> ...] ON **ALL KEYSPACES** TO <role_name>;
-
GRANT <permission>[, <permission> ...] ON **KEYSPACE <keyspace_name>** TO <role_name>;
User-defined type access control is the same as the privilege the role has on the keyspace.
-
GRANT <permission>[, <permission> ...] ON [TABLE] **<keyspace_name>.<table_name>** TO <role_name>;
Where privileges are
ALL PERMISSIONS
,DROP
,MODIFY
, andSELECT
. -
GRANT <permission>[, <permission> ...] ON **'<filter_text>' ROWS IN <keyspace_name>.<table_name>** TO role_name;
Where privileges are
ALL PERMISSIONS
,MODIFY
andSELECT
.Row-level access control (RLAC) is disabled by default. To use RLAC, set allow_row_level_security parameter to
true
in thedse.yaml
file.The location of this
dse.yaml
configuration file depends on the type of installation:-
Package installations:
/etc/dse/dse.yaml
-
Tarball installations:
<installation_location>/resources/dse/conf/dse.yaml
-
Permission matrix
The following table describes the CQL
statements enabled on the resource when a privilege is granted to a role :
Privilege type | Resource names | Permissions |
---|---|---|
CREATE KEYSPACE and DROP KEYSPACE, as well as all permissions on ancestor objects described in CREATE, ALTER, AUTHORIZE, DESCRIBE, DROP, MODIFY, and SELECT privilege. |
||
ALTER, AUTHORIZE, DESCRIBE, and SELECT privileges on the keyspace and CREATE, ALTER, AUTHORIZE, DESCRIBE, DROP, and SELECT privileges on types, tables, and rows. |
||
MODIFY, SELECT, and AUTHORIZE privileges on the table and all privileges on rows. |
||
MODIFY and SELECT privileges on the rows that match the filtering text. |
||
ALTER KEYSPACE, ALTER TABLE, ALTER TYPE, RESTRICT ROWS, and UNRESTRICT ROWS. |
||
Note: Creating a resource automatically grants AUTHORIZE permission to the role that created it. |
||
CREATE TABLE and CREATE TYPE in specified keyspace. |
||
CREATE TABLE in specified keyspace. |
||
DESCRIBE KEYSPACE, DESCRIBE TABLE, and DESCRIBE TYPE in any keyspace |
||
DESCRIBE KEYSPACE, DESCRIBE TABLE, and DESCRIBE TYPE, and DESCRIBE FUNCTION, and DESCRIBE AGGREGATE in specified keyspace |
||
DROP KEYSPACE, DROP TABLE, and DROP TYPE in any keyspace |
||
DROP TABLE, and DROP TYPE in specified keyspace |
||
INSERT, UPDATE, DELETE and TRUNCATE on any table in specified keyspace. |
||
INSERT, UPDATE, DELETE and TRUNCATE on specified table. See note for tables with materialized views (MVs). |
||
SELECT on any table. |
||
SELECT on any table in specified keyspace. |
||
SELECT on specified table. |
||
SELECT on rows that exactly match the |
To modify a base table that has a
materialized view (MV)
using an |