Repository: atlas Updated Branches: refs/heads/branch-1.0 dd33acef4 -> 131208766
ATLAS-2815: Restoring the deleted access verification calls Change-Id: I1219fa682f631d43d16cbbe9a49f375ca4ba26f5 Signed-off-by: apoorvnaik <[email protected]> (cherry picked from commit 2f5eac0) Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/13120876 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/13120876 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/13120876 Branch: refs/heads/branch-1.0 Commit: 131208766485c220593de558b47f4f7e51b960c9 Parents: dd33ace Author: apoorvnaik <[email protected]> Authored: Tue Jul 31 07:06:17 2018 -0700 Committer: apoorvnaik <[email protected]> Committed: Thu Aug 9 09:25:45 2018 -0700 ---------------------------------------------------------------------- .../repository/store/graph/v2/AtlasEntityStoreV2.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/atlas/blob/13120876/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java ---------------------------------------------------------------------- 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 6cb3c0d..28a26ab 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 @@ -119,6 +119,8 @@ public class AtlasEntityStoreV2 implements AtlasEntityStore { throw new AtlasBaseException(AtlasErrorCode.INSTANCE_GUID_NOT_FOUND, guid); } + AtlasAuthorizationUtils.verifyAccess(new AtlasEntityAccessRequest(typeRegistry, AtlasPrivilege.ENTITY_READ, new AtlasEntityHeader(ret.getEntity())), "read entity: guid=", guid); + if (LOG.isDebugEnabled()) { LOG.debug("<== getById({}, {}): {}", guid, isMinExtInfo, ret); } @@ -141,6 +143,8 @@ public class AtlasEntityStoreV2 implements AtlasEntityStore { throw new AtlasBaseException(AtlasErrorCode.INSTANCE_GUID_NOT_FOUND, guid); } + AtlasAuthorizationUtils.verifyAccess(new AtlasEntityAccessRequest(typeRegistry, AtlasPrivilege.ENTITY_READ, ret), "read entity: guid=", guid); + if (LOG.isDebugEnabled()) { LOG.debug("<== getHeaderById({}): {}", guid, ret); } @@ -165,6 +169,14 @@ public class AtlasEntityStoreV2 implements AtlasEntityStore { AtlasEntitiesWithExtInfo ret = entityRetriever.toAtlasEntitiesWithExtInfo(guids, isMinExtInfo); + if(ret != null){ + for(String guid : guids){ + AtlasEntity entity = ret.getEntity(guid); + + AtlasAuthorizationUtils.verifyAccess(new AtlasEntityAccessRequest(typeRegistry, AtlasPrivilege.ENTITY_READ, new AtlasEntityHeader(entity)), "read entity: guid=", guid); + } + } + if (LOG.isDebugEnabled()) { LOG.debug("<== getByIds({}, {}): {}", guids, isMinExtInfo, ret); } @@ -198,6 +210,8 @@ public class AtlasEntityStoreV2 implements AtlasEntityStore { uniqAttributes.toString()); } + AtlasAuthorizationUtils.verifyAccess(new AtlasEntityAccessRequest(typeRegistry, AtlasPrivilege.ENTITY_READ, new AtlasEntityHeader(ret.getEntity())), "read entity: typeName=", entityType.getTypeName(), ", uniqueAttributes=", uniqAttributes); + if (LOG.isDebugEnabled()) { LOG.debug("<== getByUniqueAttribute({}, {}): {}", entityType.getTypeName(), uniqAttributes, ret); }
