This is an automated email from the ASF dual-hosted git repository.
sarath pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/master by this push:
new 928d868 ATLAS-4170: Fixed Bulk Entity GET API to skip unauthorised
entities when skipFailedEntities is passed as True
928d868 is described below
commit 928d86864b6e4c9244cd77c18c1d3d54d6a6a836
Author: sidmishra <[email protected]>
AuthorDate: Thu Feb 18 18:00:54 2021 -0800
ATLAS-4170: Fixed Bulk Entity GET API to skip unauthorised entities when
skipFailedEntities is passed as True
Signed-off-by: Sarath Subramanian <[email protected]>
---
.../apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
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 ce58e9a..e6fe306 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
@@ -214,9 +214,8 @@ public class AtlasEntityStoreV2 implements AtlasEntityStore
{
if(ret != null){
for(String guid : guids) {
+ AtlasEntity entity = ret.getEntity(guid);
try {
- AtlasEntity entity = ret.getEntity(guid);
-
AtlasAuthorizationUtils.verifyAccess(new
AtlasEntityAccessRequest(typeRegistry, AtlasPrivilege.ENTITY_READ, new
AtlasEntityHeader(entity)), "read entity: guid=", guid);
} catch (AtlasBaseException e) {
if (RequestContext.get().isSkipFailedEntities()) {
@@ -224,7 +223,10 @@ public class AtlasEntityStoreV2 implements
AtlasEntityStore {
LOG.debug("getByIds(): ignoring failure for entity
{}: error code={}, message={}", guid, e.getAtlasErrorCode(), e.getMessage());
}
+ //Remove from referred entities
ret.removeEntity(guid);
+ //Remove from entities
+ ret.removeEntity(entity);
continue;
}