Skip to content

Commit

Permalink
feat: add atlas authZ in case of relationship evaluator
Browse files Browse the repository at this point in the history
  • Loading branch information
sumandas0 committed Dec 9, 2024
1 parent 9d71641 commit 8b9f30b
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
import static org.apache.atlas.repository.util.AccessControlUtils.POLICY_CATEGORY_PURPOSE;
import static org.apache.atlas.repository.util.AccessControlUtils.getIsPolicyEnabled;
import static org.apache.atlas.repository.util.AccessControlUtils.getPolicyCategory;
import static org.apache.atlas.services.tag.RangerServiceTag.TAG_RESOURCE_NAME;

@Component
public class CachePolicyTransformerImpl {
Expand Down Expand Up @@ -709,7 +710,14 @@ private RangerPolicy getRangerPolicy(AtlasEntityHeader atlasPolicy, String servi
//policy.setId(atlasPolicy.getGuid());
policy.setName((String) atlasPolicy.getAttribute(QUALIFIED_NAME));
policy.setService((String) atlasPolicy.getAttribute(ATTR_POLICY_SERVICE_NAME));
policy.setServiceType(serviceType);

// Adding atlas as serviceType for tag policies, as atlas_tag doesn't have all the resource available for evaluation
if (serviceType != null && serviceType.equals(TAG_RESOURCE_NAME) && policy.getService().equals("atlas")) {
policy.setServiceType("atlas");
} else {
policy.setServiceType(serviceType);
}

policy.setGuid(atlasPolicy.getGuid());
policy.setCreatedBy(atlasPolicy.getCreatedBy());
policy.setCreateTime(atlasPolicy.getCreateTime());
Expand Down

0 comments on commit 8b9f30b

Please sign in to comment.