roles
# LIST ALL PERMISSIONS;
# LIST ROLES;
# LIST AUTHORIZE ON KEYSPACE cycling;
GRANT ALL PERMISSIONS ON KEYSPACE cycling TO cycling_admin;
GRANT ALTER ON KEYSPACE cycling TO coach;
GRANT AUTHORIZE ON ALL KEYSPACES TO sys_admin;
GRANT AUTHORIZE ON KEYSPACE cycling TO cycling_admin;
GRANT AUTHORIZE FOR SELECT, TRUNCATE, UPDATE ON KEYSPACE cycling TO sam;
GRANT cycling_admin TO martin;
GRANT EXECUTE ON FUNCTION cycling.fLog(double) TO team_manager;
GRANT cycling_admin TO coach;
GRANT SELECT ON ALL KEYSPACES TO team_manager;
GRANT SELECT ON 'Sprint' ROWS IN cycling.cyclist_category TO martin;
GRANT SELECT, TRUNCATE, UPDATE ON KEYSPACE cycling TO coach;
GRANT sys_admin TO team_manager;
GRANT team_manager TO sandy;
LIST ALL PERMISSIONS;
LIST ALL PERMISSIONS;
LIST ALL PERMISSIONS;
LIST ALL PERMISSIONS;
LIST ALL PERMISSIONS;
LIST ALL PERMISSIONS;
LIST ALL PERMISSIONS;
LIST ALL PERMISSIONS;
LIST ALL PERMISSIONS;
LIST ROLES;
LIST ROLES;
LIST ROLES;
LIST ROLES;
LIST ROLES OF coach;
LIST ROLES OF coach;
LIST ROLES OF role_admin;
LIST ROLES OF sandy;
LIST ROLES OF sandy;
LIST ROLES OF sandy;
LIST ROLES OF sys_admin;
LIST ROLES OF team_manager;
# LIST ALL PERMISSIONS OF coach;
# LIST ALL PERMISSIONS ON cycling.cyclist_name;
# LIST ALL PERMISSIONS ON cycling.cyclist_name OF team_manager;
RESTRICT TRUNCATE, UPDATE, SELECT ON KEYSPACE cycling TO db_admin;
RESTRICT TRUNCATE, UPDATE, SELECT ON KEYSPACE cycling TO role_admin;
# REVOKE ALTER ON KEYSPACE cycling FROM coach;
REVOKE AUTHORIZE ON KEYSPACE cycling FROM cycling_admin;
REVOKE AUTHORIZE FOR SELECT, TRUNCATE, UPDATE ON KEYSPACE cycling FROM sam;
# REVOKE SELECT, MODIFY ON KEYSPACE cycling FROM coach;
GRANT DESCRIBE, ALTER ON ALL ROLES TO sys_admin;
REVOKE SELECT ON 'Sprint' ROWS IN cycling.cyclist_category FROM martin;
REVOKE SELECT, TRUNCATE, UPDATE ON KEYSPACE cycling FROM coach;
ALTER ROLE sandy
WITH HASHED PASSWORD = '$2a$10$Mvs4GDHlNG8MhYe5SFi7ge1R1SMbScIPVtKReSEKpqwcQOvep0Zqq';
ALTER ROLE sandy WITH PASSWORD = 'bestTeam';
ALTER ROLE sandy WITH SUPERUSER=true;
CREATE ROLE IF NOT EXISTS coach
WITH LOGIN = true
AND PASSWORD = 'All4One2day!';
CREATE ROLE IF NOT EXISTS cycling_admin;
CREATE ROLE IF NOT EXISTS db_admin
WITH superuser = true
AND login = true
AND password = 'anypasswordwilldo';
CREATE ROLE IF NOT EXISTS coach
WITH LOGIN = true
AND HASHED PASSWORD = '$2a$10$8ht4.R2aar38wyXdJxHzj.Ww8xDL5wBYGt1SJ2l46N34MBjLSyD.e';
CREATE ROLE IF NOT EXISTS martin
WITH LOGIN = true
AND PASSWORD = 'password';
CREATE ROLE IF NOT EXISTS role_admin
WITH LOGIN = true
AND PASSWORD = 'changeme';
CREATE ROLE IF NOT EXISTS sam
WITH LOGIN = true
AND PASSWORD = 'password';
CREATE ROLE IF NOT EXISTS sandy
WITH LOGIN = true
AND PASSWORD = 'password';
CREATE ROLE IF NOT EXISTS sys_admin
WITH LOGIN = true
AND PASSWORD = 'changeme'
AND SUPERUSER = true;
CREATE ROLE IF NOT EXISTS team_manager
WITH PASSWORD = 'RockIt4Us!';
DROP ROLE IF EXISTS team_manager;
# LIST ROLES OF coach;
# LIST ROLES OF sandy;
# LIST ALL PERMISSIONS OF sam;
# LIST ALL PERMISSIONS OF sandy;