From da11074e7929ae4b5acb678ebde6b02782624c81 Mon Sep 17 00:00:00 2001 From: Nikhil P Bonte Date: Fri, 19 Jan 2024 15:22:00 +0530 Subject: [PATCH] Revert RangerPolicy model --- .../atlas/plugin/model/RangerPolicy.java | 26 ------------------- .../CachePolicyTransformerImpl.java | 4 +-- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/auth-agents-common/src/main/java/org/apache/atlas/plugin/model/RangerPolicy.java b/auth-agents-common/src/main/java/org/apache/atlas/plugin/model/RangerPolicy.java index 1f70114075..24b6e28e76 100644 --- a/auth-agents-common/src/main/java/org/apache/atlas/plugin/model/RangerPolicy.java +++ b/auth-agents-common/src/main/java/org/apache/atlas/plugin/model/RangerPolicy.java @@ -84,8 +84,6 @@ public class RangerPolicy extends RangerBaseModelObject implements java.io.Seria private String zoneName; private Boolean isDenyAllElse; private Map attributes; - private String policyFilterCriteria; - private String policyResourceCategory; public RangerPolicy() { this(null, null, null, null, null, null, null, null, null, null, null); @@ -139,8 +137,6 @@ public RangerPolicy(String service, String name, String policyType, Integer poli setZoneName(zoneName); setConditions(conditions); setIsDenyAllElse(isDenyAllElse); - setPolicyFilterCriteria(null); - setPolicyResourceCategory(null); } @@ -171,8 +167,6 @@ public void updateFrom(RangerPolicy other) { setPolicyLabels(other.getPolicyLabels()); setZoneName(other.getZoneName()); setIsDenyAllElse(other.getIsDenyAllElse()); - setPolicyFilterCriteria(other.getPolicyFilterCriteria()); - setPolicyResourceCategory(other.getPolicyResourceCategory()); } public Map getAttributes() { @@ -539,22 +533,6 @@ public void setIsDenyAllElse(Boolean isDenyAllElse) { this.isDenyAllElse = isDenyAllElse == null ? Boolean.FALSE : isDenyAllElse; } - public String getPolicyFilterCriteria() { - return policyFilterCriteria; - } - - public void setPolicyFilterCriteria(String policyFilterCriteria) { - this.policyFilterCriteria = policyFilterCriteria; - } - - public String getPolicyResourceCategory() { - return policyResourceCategory; - } - - public void setPolicyResourceCategory(String policyResourceCategory) { - this.policyResourceCategory = policyResourceCategory; - } - @Override public String toString( ) { StringBuilder sb = new StringBuilder(); @@ -688,10 +666,6 @@ public StringBuilder toString(StringBuilder sb) { } sb.append(", zoneName=").append(zoneName); - sb.append(", policyFilterCriteria=").append(policyFilterCriteria); - - sb.append(", policyResourceCategory=").append(policyResourceCategory); - sb.append(", isDenyAllElse={").append(isDenyAllElse).append("} "); sb.append("}"); diff --git a/auth-agents-common/src/main/java/org/apache/atlas/policytransformer/CachePolicyTransformerImpl.java b/auth-agents-common/src/main/java/org/apache/atlas/policytransformer/CachePolicyTransformerImpl.java index 8d0761bfcd..1245255e49 100644 --- a/auth-agents-common/src/main/java/org/apache/atlas/policytransformer/CachePolicyTransformerImpl.java +++ b/auth-agents-common/src/main/java/org/apache/atlas/policytransformer/CachePolicyTransformerImpl.java @@ -533,7 +533,7 @@ private RangerPolicy getRangerPolicy(AtlasEntityHeader atlasPolicy, String servi policy.setCreatedBy(atlasPolicy.getCreatedBy()); policy.setCreateTime(atlasPolicy.getCreateTime()); policy.setIsEnabled(getIsPolicyEnabled(atlasPolicy)); - policy.setPolicyResourceCategory(getPolicyResourceCategory(atlasPolicy)); + //policy.setPolicyResourceCategory(getPolicyResourceCategory(atlasPolicy)); policy.setConditions(getPolicyConditions(atlasPolicy)); policy.setValiditySchedules(getPolicyValiditySchedule(atlasPolicy)); @@ -544,7 +544,7 @@ private RangerPolicy getRangerPolicy(AtlasEntityHeader atlasPolicy, String servi if (POLICY_SERVICE_NAME_ABAC.equals(atlasPolicy.getAttribute(ATTR_POLICY_SERVICE_NAME))) { String policyFilterCriteria = getPolicyFilterCriteria(atlasPolicy); - policy.setPolicyFilterCriteria(policyFilterCriteria); + //policy.setPolicyFilterCriteria(policyFilterCriteria); } return policy;