josh-mckenzie commented on a change in pull request #1245:
URL: https://github.com/apache/cassandra/pull/1245#discussion_r724240442



##########
File path: src/java/org/apache/cassandra/service/ClientState.java
##########
@@ -425,9 +427,22 @@ public void ensurePermission(Permission permission, 
Function function)
 
     private void ensurePermissionOnResourceChain(Permission perm, IResource 
resource)
     {
-        for (IResource r : Resources.chain(resource))
-            if (authorize(r).contains(perm))
-                return;
+        if (DatabaseDescriptor.getAuthFromRoot())

Review comment:
       The casting we can fix w/the current implementation if we're so inclined 
but I agree that the compactness and readability are improved with this 
revision.
   
   A minor observation: I don't know if a reverse iterator from the java libs 
or Lists.reverse's held state from guava are comparable or not in terms of 
state, but whatever differences there may be there I expect to be trivial 
enough to be more than made up for in code clarity and lack of repetition.




-- 
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