From 81833a122d4d05d6a07900b099c83ece0c9360d7 Mon Sep 17 00:00:00 2001 From: Nikhil P Bonte Date: Thu, 30 Nov 2023 21:50:12 +0530 Subject: [PATCH] Persona alias for product and sub-domain reads --- .../repository/store/aliasstore/ESAliasStore.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/repository/src/main/java/org/apache/atlas/repository/store/aliasstore/ESAliasStore.java b/repository/src/main/java/org/apache/atlas/repository/store/aliasstore/ESAliasStore.java index c8ccfaf2a7..6e51565431 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/aliasstore/ESAliasStore.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/aliasstore/ESAliasStore.java @@ -204,15 +204,24 @@ private void personaPolicyToESDslClauses(List policies, terms.add(glossaryQName); allowClauseList.add(mapOf("wildcard", mapOf(QUALIFIED_NAME, "*@" + glossaryQName))); } - } else if (getPolicyActions(policy).contains(ACCESS_READ_PERSONA_DOMAIN) - || getPolicyActions(policy).contains(ACCESS_READ_PERSONA_SUB_DOMAIN) - || getPolicyActions(policy).contains(ACCESS_READ_PERSONA_PRODUCT)) { + } else if (getPolicyActions(policy).contains(ACCESS_READ_PERSONA_DOMAIN)) { for (String asset : assets) { terms.add(asset); allowClauseList.add(mapOf("wildcard", mapOf(QUALIFIED_NAME, asset + "/*"))); } + } else if (getPolicyActions(policy).contains(ACCESS_READ_PERSONA_SUB_DOMAIN)) { + for (String asset : assets) { + //terms.add(asset); + allowClauseList.add(mapOf("wildcard", mapOf(QUALIFIED_NAME, asset + "/domain/*"))); + } + + } else if (getPolicyActions(policy).contains(ACCESS_READ_PERSONA_PRODUCT)) { + for (String asset : assets) { + //terms.add(asset); + allowClauseList.add(mapOf("wildcard", mapOf(QUALIFIED_NAME, asset + "/*/product/*"))); + } } }