diff --git a/repository/src/main/java/org/apache/atlas/discovery/AtlasAuthorization.java b/repository/src/main/java/org/apache/atlas/discovery/AtlasAuthorization.java index 3e55a884ad..0c04df1ab2 100644 --- a/repository/src/main/java/org/apache/atlas/discovery/AtlasAuthorization.java +++ b/repository/src/main/java/org/apache/atlas/discovery/AtlasAuthorization.java @@ -301,7 +301,10 @@ private static boolean validateResourcesForCreateEntity(List resou if ("entity".equals(resource)) { String assetQualifiedName = (String) entity.getAttribute(QUALIFIED_NAME); - Optional match = values.stream().filter(x -> assetQualifiedName.matches(x.replace("*", ".*"))).findFirst(); + Optional match = values.stream().filter(x -> assetQualifiedName.matches(x + .replace("{USER}", getCurrentUserName()) + .replace("*", ".*"))) + .findFirst(); if (!match.isPresent()) { resourcesMatched = false; diff --git a/webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java b/webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java index b63398b422..b218ef4f07 100644 --- a/webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java +++ b/webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java @@ -172,7 +172,11 @@ public List evaluatePolicies(List