How to create user/permission with examples in Cassandra?

CREATE USER in Cassandra:

CREATE USER alice WITH PASSWORD 'password_a' SUPERUSER;
CREATE USER bob WITH PASSWORD 'password_b' NOSUPERUSER;

CREATE USER is equivalent to CREATE ROLE where the LOGIN option is true. So, the following pairs of statements are equivalent:

CREATE USER alice WITH PASSWORD 'password_a' NOSUPERUSER;
CREATE ROLE alice WITH PASSWORD = 'password_a' AND LOGIN = true AND SUPERUSER = false;

ALTER USER

ALTER USER alice WITH PASSWORD 'PASSWORD_A'; 
ALTER USER bob SUPERUSER;

LIST USERS

LIST ROLES; 
LIST USERS;

GRANT PERMISSION

GRANT SELECT ON ALL KEYSPACES TO data_reader; 
GRANT MODIFY ON KEYSPACE keyspace1 TO data_writer; 
GRANT DROP ON keyspace1.table1 TO schema_owner; 

REVOKE PERMISSION

REVOKE SELECT ON ALL KEYSPACES FROM data_reader;
REVOKE MODIFY ON KEYSPACE keyspace1 FROM data_writer;
REVOKE DROP ON keyspace1.table1 FROM schema_owner;
REVOKE EXECUTE ON FUNCTION keyspace1.user_function( int ) FROM report_writer;
REVOKE DESCRIBE ON ALL ROLES FROM role_admin;

LIST PERMISSIONS

LIST ALL PERMISSIONS OF alice; 
LIST ALL PERMISSIONS ON keyspace1.table1 OF bob; 
LIST SELECT PERMISSIONS OF carlos; 


20 views

Join our mail group. Get a free Linux account on Cloud.

Never miss a post!

Want a free Linux account?  This account can be used to login to our cloud server and practice Linux commands.

 
kamateravps.gif
topbackgroud.png

✔ Linux Commands   ✔ Linux Skills    ✔ LinuxPerformance   ✔ Linux Interview

Some articles are from the public internet. If you find your article misused or undesired here and you don't want us to display it, please let us know and we'll remove it immediately.