liveBook · Manning

Role

As explained in ScyllaDB in Action

A role is a database identity to which permissions can be assigned and through which users can receive those permissions.

A role is a database identity that receives permissions. Clients connect as roles, while authorization determines which database actions those roles may perform. section 10.6.2 section 10.7

A newly created role has no permissions by default and is not necessarily allowed to log in. Separate administrative and application roles to limit what each client can do. section 10.6.2

Use roles to structure access:

  • Create a role with CREATE ROLE. section 10.6.2
  • Grant permissions with GRANT, including SELECT, MODIFY, CREATE, ALTER, DROP, AUTHORIZE, and DESCRIBE. section 10.6.2
  • Scope permissions to a keyspace, table, or another role. section 10.7
  • Grant one role to another so the recipient inherits its permissions. section 10.6.2
  • Enable login and set credentials only for roles that applications or users must authenticate as. section 10.6.2

Restaurant-review application

Create an application role, grant it access to the reviews keyspace, then create a login role for the API and grant the application role to it: CREATE ROLE application; GRANT SELECT ON KEYSPACE reviews TO application; GRANT MODIFY ON KEYSPACE reviews TO application; CREATE ROLE reviews_api WITH PASSWORD = 'password' AND LOGIN = true; GRANT application TO reviews_api. The driver authenticates as reviews_api, allowing the API to read and write reviews without allowing it to drop the keyspace. section 10.6.3

How ScyllaDB in Action covers it

How deep it goes
Explains creation, permission grants, inheritance, login configuration, and driver authentication, but does not detail internal authorization implementation.
Examples
Uses application and reviews_api roles, reviews-keyspace SELECT and MODIFY grants, LIST ROLES output, and Python driver credentials.
What it assumes
Assumes basic ScyllaDB connection and CQL familiarity while introducing authentication, authorization, roles, and permissions practically.
What you can do after
Operate/configure ScyllaDB access by creating roles, granting scoped permissions, assigning inherited roles, and authenticating applications.
How it connects
Connects roles with permissions, authentication, authorization, superusers, keyspaces, and database drivers.

Also explained in

Compare how 11 books explain role →

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.