Skip to content

Commit

Permalink
Merge pull request #2253 from atlanhq/gov-1233
Browse files Browse the repository at this point in the history
GOV-1233 Fix Tag based evaluation for asset
  • Loading branch information
nikhilbonte21 authored Aug 10, 2023
2 parents a367cd4 + 1e6e12d commit 6e58258
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void authorizeResourceUpdate(AtlasEntity resourceEntity, AtlasVertex ResourceVer
if (asset != null) {
//Found linked asset in payload
AtlasVertex assetVertex = entityRetriever.getEntityVertex(asset);
assetEntity = entityRetriever.toAtlasEntityHeader(assetVertex);
assetEntity = new AtlasEntityHeader(entityRetriever.toAtlasEntity(assetVertex));

} else {
//Check for linked asset in store
Expand All @@ -76,7 +76,7 @@ void authorizeResourceUpdate(AtlasEntity resourceEntity, AtlasVertex ResourceVer
if (atlasVertexIterator.hasNext()) {
//Found linked asset in store
AtlasVertex assetVertex = (AtlasVertex) atlasVertexIterator.next();
assetEntity = entityRetriever.toAtlasEntityHeader(assetVertex);
assetEntity = new AtlasEntityHeader(entityRetriever.toAtlasEntity(assetVertex));
}
}

Expand All @@ -101,7 +101,7 @@ void authorizeResourceDelete(AtlasVertex resourceVertex) throws AtlasBaseExcepti

AtlasObjectId asset = getAssetRelationAttr(resourceEntity);
if (asset != null) {
AtlasEntityHeader assetEntity = entityRetriever.toAtlasEntityHeader(asset.getGuid());
AtlasEntityHeader assetEntity = new AtlasEntityHeader(entityRetriever.toAtlasEntity(asset.getGuid()));
verifyAssetAccess(assetEntity, AtlasPrivilege.ENTITY_UPDATE, resourceEntity, AtlasPrivilege.ENTITY_DELETE);
} else {
//No linked asset to the Resource, check for resource delete permission
Expand Down

0 comments on commit 6e58258

Please sign in to comment.