sarankk commented on code in PR #220:
URL: https://github.com/apache/cassandra-sidecar/pull/220#discussion_r2114938291


##########
server/src/main/java/org/apache/cassandra/sidecar/db/SystemAuthDatabaseAccessor.java:
##########
@@ -133,10 +137,16 @@ public Map<String, Set<Authorization>> 
findAllRolesAndPermissions()
      */
     public boolean isSuperUser(String role)
     {
-        BoundStatement statement = 
tableSchema.roleSuperuserStatus().bind(role);
+        Statement statement = new 
SimpleStatement(String.format(tableSchema.unPreparedListRoles(), role));
         ResultSet result = execute(statement);
-        Row row = result.one();
-        return row != null && row.getBool("is_superuser");
+        for (Row row : result)

Review Comment:
   Yes, we use `LIST ROLES` statement to get all members of a role. If any of 
the members hold super user status, then we want to return `true` for current 
user. 



-- 
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: pr-unsubscr...@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org
For additional commands, e-mail: pr-h...@cassandra.apache.org

Reply via email to