mneethiraj commented on code in PR #982:
URL: https://github.com/apache/ranger/pull/982#discussion_r3321354662


##########
agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerAbstractPolicyEvaluator.java:
##########
@@ -199,6 +204,7 @@ public void getResourceACLs(RangerAccessRequest request, 
RangerResourceACLs acls
 
             if (policyType == RangerPolicy.POLICY_TYPE_ACCESS) {
                 updateFromPolicyACLs(isConditionalMatch, acls, 
targetAccessTypes);
+                filterAclResultsByValiditySchedule(request, acls);

Review Comment:
   @rameeshm  - `acls` might have permissions granted by other policies for 
this user/groups/roles. `filterAclResultsByValiditySchedule()` might remove 
them, right? That will not be correct. Instead of updating `acls` here, I 
suggest the caller should check if a permission is granted conditionally - like:
   
   ```
   AccessResult user1Select =  acls.getUserACLs().get("user1").get("select");
   
   boolean isAllowed = user1Select.getResult() == ACCESS_ALLOWED;
   // valid values are:
   //   ACCESS_DENIED(-1)
   //   ACCESS_UNDETERMINED(0)
   //   ACCESS_ALLOWED(1)
   //   ACCESS_CONDITIONAL(2)
   ```



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

Reply via email to