CASSANDRA-18868 Added documentation of granting permissions for all tables in a keyspace

This commit is contained in:
Ayantika19 2024-10-14 11:10:02 +05:30 committed by Patrick McFadin
parent 1f9ac53b75
commit f79e8b3a0d
5 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,2 @@
grant_permission_statement ::= GRANT permission ON ALL TABLES IN KEYSPACE keyspace_name TO user_name;
permission ::= CREATE | ALTER | DROP | SELECT | MODIFY | AUTHORIZE | UNMASK | SELECT_MASKED

View File

@ -0,0 +1 @@
GRANT ALTER ON ALL TABLES IN KEYSPACE keyspace_name TO user_name;

View File

@ -0,0 +1 @@
GRANT DROP ON ALL TABLES IN KEYSPACE keyspace_name TO user_name;

View File

@ -0,0 +1 @@
GRANT MODIFY ON ALL TABLES IN KEYSPACE keyspace_name TO user_name;

View File

@ -634,6 +634,42 @@ include::cassandra:example$CQL/grant_describe.cql[]
This grants any user with the `role_admin` role permission to view any
and all roles in the system with a `LIST ROLES` statement.
==== GRANT PERMISSION FOR ALL TABLES IN A KEYSPACE
Granting permission to all tables and user types in a keyspace uses
`GRANT <permission-name>` statement:
[source,bnf]
----
include::example$BNF/grant_permission_all_tables_statement.bnf[]
----
For example:
[source,cql]
----
include::example$CQL/grant_drop_all_tables.cql[]
----
This command grants any user with the `user_name` role permission to execute
`DROP` statements on all the tables across the keyspace `keyspace_name`
[source,cql]
----
include::example$CQL/grant_alter_all_tables.cql[]
----
This command grants any user with the `user_name` role permission to execute
`ALTER` statements on all the tables across the keyspace `keyspace_name`
[source,cql]
----
include::example$CQL/grant_modify_all_tables.cql[]
----
This command grants any user with the `user_name` role permission to execute
`MODIFY` statements on all the tables across the keyspace `keyspace_name`
==== GRANT ALL
When the `GRANT ALL` form is used, the appropriate set of permissions is