You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the following statements cause an incorrect error:
Use HELP for help.
cassandra@cqlsh> CREATE KEYSPACE k;
cassandra@cqlsh> USE k;
cassandra@cqlsh:k> CREATE TABLE k.t (id BIGINT, s TEXT, PRIMARY KEY(id));
cassandra@cqlsh:k> CREATE ROLE r1 WITH PASSWORD = 'p' AND LOGIN = true;
cassandra@cqlsh:k> CREATE ROLE r2 WITH PASSWORD = 'p' AND LOGIN = true;
cassandra@cqlsh:k> GRANT r1 TO r2;
cassandra@cqlsh:k> GRANT SELECT ON t TO r2;
cassandra@cqlsh:k> CREATE ROLE r3 WITH PASSWORD = 'p' AND LOGIN = true;
cassandra@cqlsh:k> GRANT r2 TO r3;
cassandra@cqlsh:k> GRANT MODIFY ON t TO r3;
cassandra@cqlsh:k> LOGIN r3;
Password:
r3@cqlsh:k> INSERT INTO t (id,s) VALUES (123, 'abc');
Unauthorized: Error from server: code=2100 [Unauthorized] message="Unauthorized. User r3 has no MODIFY permission on <table k.t> or any of its parents
INSERT INTO t (id,s) VALUES (123, 'abc');
^^^^
(ql error -4)"
r3@cqlsh:k>
But removing statement GRANT r2 TO r3; fixes the issue:
[cqlsh 5.0.1 | Cassandra 3.9-SNAPSHOT | CQL spec 3.4.2 | Native protocol v4]
Use HELP for help.
cassandra@cqlsh> CREATE KEYSPACE k;
cassandra@cqlsh> USE k;
cassandra@cqlsh:k> CREATE TABLE k.t (id BIGINT, s TEXT, PRIMARY KEY(id));
cassandra@cqlsh:k> CREATE ROLE r1 WITH PASSWORD = 'p' AND LOGIN = true;
cassandra@cqlsh:k> CREATE ROLE r2 WITH PASSWORD = 'p' AND LOGIN = true;
cassandra@cqlsh:k> GRANT r1 TO r2;
cassandra@cqlsh:k> GRANT SELECT ON t TO r2;
cassandra@cqlsh:k> CREATE ROLE r3 WITH PASSWORD = 'p' AND LOGIN = true;
cassandra@cqlsh:k> GRANT MODIFY ON t TO r3;
cassandra@cqlsh:k> LOGIN r3;
Password:
r3@cqlsh:k> INSERT INTO t (id,s) VALUES (123, 'abc');
r3@cqlsh:k>
The text was updated successfully, but these errors were encountered:
… the client's cache
Summary:
Currently, when processing permissions for a specific resource in the cache, we could end up replacing a permission already in the cache for the same resource. This only affects the cache and not the permissions that are stored on disk.
For example:
If for role r, the cache has permission MODIFY for resource t, and we process another permission SELECT for the same resource, we will replace MODIFY, instead of adding SELECT. This diff fixes this issue.
Test Plan: New unit test. Verified that it failed without the new fix.
Reviewers: oleg, bogdan
Reviewed By: bogdan
Subscribers: kannan, ybase
Differential Revision: https://phabricator.dev.yugabyte.com/D8182
Currently the following statements cause an incorrect error:
But removing statement
GRANT r2 TO r3;
fixes the issue:The text was updated successfully, but these errors were encountered: