Create database permissions
HCD uses CQL to manage permissions for users and applications.
You can create permissions for users and applications using the GRANT
statement. The GRANT
statement assigns permissions to a user or role on a resource.
The REVOKE
statement removes permissions from a user or role on a resource.
The security quickstart in the CQL documentation provides a good starting point for creating roles and setting permissions.
The following example demonstrates how to create a role and grant permissions to the role:
CREATE ROLE IF NOT EXISTS <role_name> WITH PASSWORD = '<password>' AND LOGIN = true;
GRANT SELECT ON cycling.comments_vs TO <role_name>;
and to revoke permissions:
REVOKE SELECT ON cycling.comments_vs FROM <role_name>;