ramackri commented on code in PR #980:
URL: https://github.com/apache/ranger/pull/980#discussion_r3378376659


##########
security-admin/src/main/java/org/apache/ranger/biz/PolicyRefUpdater.java:
##########
@@ -210,6 +210,9 @@ public void createNewPolMappingForRefTable(RangerPolicy 
policy, XXPolicy xPolicy
             createPrincipalsIfAbsent = false;
         }
 
+        final boolean policyExists = xPolicy != null && xPolicy.getId() != null
+                && daoMgr.getXXPolicy().getById(xPolicy.getId()) != null;

Review Comment:
   Done 



##########
agents-common/src/main/java/org/apache/ranger/plugin/store/RoleStore.java:
##########
@@ -28,9 +28,9 @@
 public interface RoleStore {
     void init() throws Exception;
 
-    RangerRole createRole(RangerRole role, Boolean createNonExistUserGroup) 
throws Exception;
+    RangerRole createRole(RangerRole role, Boolean createNonExistUserGroup, 
Boolean isRefTableCleanupRequired) throws Exception;

Review Comment:
   Done 



##########
security-admin/src/main/java/org/apache/ranger/biz/PolicyRefUpdater.java:
##########
@@ -551,25 +554,23 @@ public void cleanupPolicyRefGroups(Set<String> 
policyGroups, Long policyId, XXPo
 
     public enum PRINCIPAL_TYPE { USER, GROUP, ROLE }
 
-    private boolean doesPolicyExist(XXPolicy policy) {
-        return daoMgr.getXXPolicy().getById(policy.getId()) != null;
-    }
-
     private class PolicyRoleAssociator implements Runnable {
         private final String   name;
         private final Long     roleId;
         private final XXPolicy xPolicy;
+        private final boolean  policyExists;
 
-        PolicyRoleAssociator(String name, Long roleId, XXPolicy xPolicy) {
-            this.name    = name;
-            this.roleId  = roleId;
-            this.xPolicy = xPolicy;
+        PolicyRoleAssociator(String name, Long roleId, XXPolicy xPolicy, 
boolean policyExists) {
+            this.name         = name;
+            this.roleId       = roleId;
+            this.xPolicy      = xPolicy;
+            this.policyExists = policyExists;
         }
 
         public XXPolicyRefRole getPolicyRef() {
             Long id = resolveRoleId(false);

Review Comment:
   Done 



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