vyommani commented on code in PR #1382:
URL: https://github.com/apache/ranger/pull/1382#discussion_r4690058147
##########
security-admin/src/main/java/org/apache/ranger/biz/RangerPolicyAdminImpl.java:
##########
@@ -860,27 +871,97 @@ private void collectAccessTypes(RangerPolicy policy,
RangerServiceDef serviceDef
}
private void collectAccessTypes(Map<String, Collection<String>>
expandedAccesses, List<? extends RangerPolicy.RangerPolicyItem> policyItems,
Map<String, Set<String>> userAccesses, Map<String, Set<String>> groupAccesses,
Map<String, Set<String>> roleAccesses) {
+ collectAccessTypes(expandedAccesses, null, policyItems, userAccesses,
groupAccesses, roleAccesses);
+ }
+
+ private void collectAccessTypes(Map<String, Collection<String>>
expandedAccesses, String itemType, List<? extends
RangerPolicy.RangerPolicyItem> policyItems, Map<String, Set<String>>
userAccesses, Map<String, Set<String>> groupAccesses, Map<String, Set<String>>
roleAccesses) {
for (RangerPolicy.RangerPolicyItem item : policyItems) {
Set<String> accessTypes = new HashSet<>();
for (RangerPolicy.RangerPolicyItemAccess access :
item.getAccesses()) {
Review Comment:
Intentional. Line 768 is getAllAccessTypes(), the full set used when the
delta is empty or the policy scope changes. The isAllowed check is only for the
diff: the engine ignores that access, so a flip to false must show up as a
removed access type. Skipping it in getAllAccessTypes() would drop it from the
full check.
--
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]