Sanket-Shelar commented on code in PR #1125:
URL: https://github.com/apache/ranger/pull/1125#discussion_r3718705598


##########
security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java:
##########
@@ -3833,24 +3839,26 @@ private List<RangerPolicy> 
getAllFilteredPolicyList(SearchFilter filter, HttpSer
 
         if (!CollectionUtils.isEmpty(policyLists)) {
             for (RangerPolicy policy : policyLists) {
-                if (policy != null) {
+                if (policy != null && !isGdsPolicy(policy)) {
                     //set createTime & updateTime Time as null since exported 
policies dont need this
                     policy.setCreateTime(null);
                     policy.setUpdateTime(null);
 
                     orderedPolicies.put(policy.getId(), policy);
                 }
             }
-            if (!orderedPolicies.isEmpty()) {
-                policyLists.clear();
 
-                policyLists.addAll(orderedPolicies.values());
-            }
+            policyLists.clear();
+            policyLists.addAll(orderedPolicies.values());
         }
 
         return policyLists;
     }
 
+    private boolean isGdsPolicy(RangerPolicy policy) {
+        return EMBEDDED_SERVICEDEF_GDS_NAME.equals(policy.getServiceType()) || 
ServiceDBStore.GDS_SERVICE_NAME.equals(policy.getService());

Review Comment:
   It was added as an additional check, in case serviceType is not present. I 
have udpated the condition to only check for serviceType match.



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