cecemei commented on code in PR #17564:
URL: https://github.com/apache/druid/pull/17564#discussion_r1906169178


##########
server/src/main/java/org/apache/druid/server/security/AuthorizationUtils.java:
##########
@@ -181,54 +179,64 @@ public static Access authorizeAllResourceActions(
           resourceAction.getAction()
       );
       if (!access.isAllowed()) {
-        return access;
+        return AuthorizationResult.deny(access.getMessage());
       } else {
         resultCache.add(resourceAction);
+        if (resourceAction.getAction().equals(Action.READ)
+            && 
RESTRICTION_APPLICABLE_RESOURCE_TYPES.contains(resourceAction.getResource().getType()))
 {
+          policyFilters.put(resourceAction.getResource().getName(), 
access.getPolicy());
+        } else if (access.getPolicy().isPresent()) {
+          throw DruidException.defensive(
+              "Policy should only present when reading a table, but was 
present for %s",

Review Comment:
   updated



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