fateh288 commented on code in PR #410:
URL: https://github.com/apache/ranger/pull/410#discussion_r1831819860
##########
agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerDefaultPolicyEvaluator.java:
##########
@@ -1512,4 +1504,27 @@ private List<RangerConditionEvaluator>
createPolicyConditionEvaluators(RangerPol
return ret;
}
+ private static boolean isMatchForResourceMatchingScope(final
RangerAccessRequest.ResourceMatchingScope scope, final
RangerPolicyResourceMatcher.MatchType matchType, boolean isAnyMatch) {
+ boolean ret = false;
+ if (isAnyMatch){
+ ret = matchType !=
RangerPolicyResourceMatcher.MatchType.NONE;
+ }
+ else if (scope!=null) {
+ switch (scope) {
+ case SELF_OR_DESCENDANTS: {
+ ret = matchType !=
RangerPolicyResourceMatcher.MatchType.NONE;
+ break;
+ }
+ case SELF_AND_ALL_DESCENDANTS: {
+ ret = matchType !=
RangerPolicyResourceMatcher.MatchType.NONE;
Review Comment:
matchType=DESCENDANT is the scenario we are also interested in.
if policy resource is (t1,cf1,c1) and accessed resource is (t1,cf1) then
matchType is DESCENDANT which is what we want to match as it is a valid policy
to evaluate for this case.
--
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]