From 6ea59301f3f08a9defb80a63146b6607ebd1f4fe Mon Sep 17 00:00:00 2001 From: Nikhil P Bonte Date: Mon, 4 Dec 2023 23:07:22 +0530 Subject: [PATCH] Auth exception message --- .../java/org/apache/atlas/discovery/AtlasAuthorization.java | 2 +- .../atlas/repository/store/graph/v2/AtlasEntityStoreV2.java | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) 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 8f264bb327..95e319c145 100644 --- a/repository/src/main/java/org/apache/atlas/discovery/AtlasAuthorization.java +++ b/repository/src/main/java/org/apache/atlas/discovery/AtlasAuthorization.java @@ -116,7 +116,7 @@ public static void verifyAccess(String guid, String action) throws AtlasBaseExce try { if (!isAccessAllowed(guid, action)) { - throw new AtlasBaseException(AtlasErrorCode.UNAUTHORIZED_ACCESS, RequestContext.getCurrentUser(), guid); + throw new AtlasBaseException(AtlasErrorCode.UNAUTHORIZED_ACCESS, userName, action + ":" + guid); } } catch (AtlasBaseException e) { throw e; diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java index 6321bd0212..e8fe8e7b82 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java @@ -104,7 +104,6 @@ import static java.lang.Boolean.FALSE; import static org.apache.atlas.AtlasConfiguration.STORE_DIFFERENTIAL_AUDITS; import static org.apache.atlas.bulkimport.BulkImportResponse.ImportStatus.FAILED; -import static org.apache.atlas.discovery.AtlasAuthorization.isCreateAccessAllowed; import static org.apache.atlas.discovery.AtlasAuthorization.verifyAccess; import static org.apache.atlas.discovery.AtlasAuthorization.verifyDeleteEntityAccess; import static org.apache.atlas.model.instance.AtlasEntity.Status.ACTIVE;