liveBook · Manning

Grant statement

As explained in ScyllaDB in Action

A GRANT statement is a database command that assigns permissions or role membership to a role.

A GRANT statement assigns permissions on a resource to a role, or grants one role to another. In ScyllaDB, it is central to role-based access control. section 10.6.2 section 10.7

Use the form GRANT (permission | "ALL PERMISSIONS") ON resource TO role.

  • Permissions include CREATE, ALTER, DROP, SELECT, MODIFY, AUTHORIZE, and DESCRIBE. section 10.6.2
  • Resources can be a keyspace, a table such as reviews.articles, a specific role, all keyspaces, or all roles. section 10.6.2
  • Scope access to the minimum necessary resource; for example, a keyspace-level DROP permission affects every table in that keyspace. section 10.6.2

Granting application access

After creating the application role, grant it permissions for the reviews keyspace: GRANT SELECT ON KEYSPACE reviews TO application; and GRANT MODIFY ON KEYSPACE reviews TO application;. A login role can then inherit these permissions with GRANT application TO reviews_api;. section 10.6.2

Listing 10.29 Granting SELECT and MODIFY to the application role
cassandra@cqlsh> GRANT SELECT ON KEYSPACE reviews TO application;
cassandra@cqlsh> GRANT MODIFY ON KEYSPACE reviews TO application;

Shows executable CQL statements for granting SELECT and MODIFY on the reviews keyspace. section 10.6.2

How ScyllaDB in Action covers it

How deep it goes
Defines syntax, permission types, resource forms, least-privilege scoping, and role inheritance through runnable commands.
Examples
Demonstrates SELECT and MODIFY grants on the reviews keyspace and granting application to reviews_api.
What it assumes
Assumes familiarity with roles and resources while defining permissions, keyspaces, tables, and role-based access control.
What you can do after
Operate/configure ScyllaDB authorization by assigning permissions to roles and composing roles through inheritance.
How it connects
Connects role-based access control with permissions, keyspaces, tables, authentication, authorization, and role inheritance.

Also explained in

Compare how 3 books explain grant statement →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of ScyllaDB in Action. The section links point to the parts of the book it draws on.