Maxwell-Guo commented on code in PR #3905:
URL: https://github.com/apache/cassandra/pull/3905#discussion_r1959727877


##########
test/unit/org/apache/cassandra/auth/GrantAndRevokeTest.java:
##########
@@ -472,6 +477,16 @@ public void testGrantOnAllKeyspaces() throws Throwable
         executeNet(ProtocolVersion.CURRENT, "INSERT INTO system.peers_v2(peer, 
peer_port, data_center) VALUES ('127.0.100.100', 7012, 'invalid_dc')");
     }
 
+    @Test
+    public void testGrantOnVirtualKeyspaces() throws Throwable
+    {
+        useSuperUser();
+        executeNet(String.format("CREATE ROLE %s WITH LOGIN = TRUE AND 
password='%s'", user, pass));
+        executeNet(ProtocolVersion.CURRENT, format("GRANT SELECT PERMISSION ON 
KEYSPACE system_virtual_schema TO %s", user));
+        executeNet(ProtocolVersion.CURRENT, format("GRANT SELECT PERMISSION ON 
KEYSPACE system_views TO %s", user));
+        executeNet(ProtocolVersion.CURRENT, format("GRANT SELECT PERMISSION ON 
TABLE system_views.local TO %s", user));

Review Comment:
   I think we should also add some CQLs that were executed by the newly created 
user, such as:
   `select * from system_views.xxx` and `select * from 
system_virtual_schema.xxx`, and also verify whether the results are correct.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to