Repository: atlas
Updated Branches:
  refs/heads/master 42d801f75 -> 2f5eac0b2


ATLAS-2815: Restoring the deleted access verification calls

Change-Id: I1219fa682f631d43d16cbbe9a49f375ca4ba26f5
Signed-off-by: apoorvnaik <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/2f5eac0b
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/2f5eac0b
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/2f5eac0b

Branch: refs/heads/master
Commit: 2f5eac0b234bbbba14c42880eeb10090067b5541
Parents: 42d801f
Author: apoorvnaik <[email protected]>
Authored: Tue Jul 31 07:06:17 2018 -0700
Committer: apoorvnaik <[email protected]>
Committed: Thu Aug 9 09:24:05 2018 -0700

----------------------------------------------------------------------
 .../repository/store/graph/v2/AtlasEntityStoreV2.java | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/2f5eac0b/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);
         }

Reply via email to