fateh288 commented on code in PR #588:
URL: https://github.com/apache/ranger/pull/588#discussion_r2143342226
##########
agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerDefaultPolicyEvaluator.java:
##########
@@ -613,8 +613,12 @@ protected void evaluatePolicyItems(RangerAccessRequest
request, MatchType matchT
if (getPolicyPriority() >= oldPriority &&
allowResult != null && (oneRequest.isAccessTypeAny() ||
RangerAccessRequestUtil.getIsAnyAccessInContext(oneRequest.getContext()))) {
accessTypeResults.put(accessType, allowResult);
} else {
- if (getPolicyPriority() > oldPriority &&
denyResult != null) {
- accessTypeResults.put(accessType,
denyResult);
+ if (getPolicyPriority() > oldPriority) {
+ if (allowResult != null) {
Review Comment:
@mneethiraj
Can you explain why we have different behavior for anyAccess ?
Can we simplify the code to below irrespective of whether access type is any
or not ? (I can't understand the case when the policy priority is same as old
priority (i.e. why >= is there in the first condition and not >) .
```
if (getPolicyPriority() > oldPriority) {
if (allowResult != null) {
accessTypeResults.put(accessType, allowResult);
}
else if (denyResult != null) {
accessTypeResults.put(accessType, denyResult);
}
}
```
--
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]