Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create atlas servicepolicies instead of tag #3855

Merged
merged 2 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading
Loading