This is an automated email from the ASF dual-hosted git repository.
nixon pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new 038a73a ATLAS-3550 :- Add authorize check for
partialUpdateEntityAttrByGuid API call
038a73a is described below
commit 038a73a0dcd19dd75a49deb5fcfbf9bb968db6a6
Author: nixonrodrigues <[email protected]>
AuthorDate: Fri Dec 6 14:49:21 2019 +0530
ATLAS-3550 :- Add authorize check for partialUpdateEntityAttrByGuid API
call
(cherry picked from commit 65a62b05369a2dbb75d26971dc071b28b1119331)
---
.../apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java | 4 ++++
1 file changed, 4 insertions(+)
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 bc4cc8b..ea5e6ab 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
@@ -376,6 +376,8 @@ public class AtlasEntityStoreV2 implements AtlasEntityStore
{
entity.setGuid(guid);
+ AtlasAuthorizationUtils.verifyAccess(new
AtlasEntityAccessRequest(typeRegistry, AtlasPrivilege.ENTITY_UPDATE, new
AtlasEntityHeader(entity)), "update entity ByUniqueAttributes");
+
return createOrUpdate(new AtlasEntityStream(updatedEntityInfo), true,
false);
}
@@ -391,6 +393,8 @@ public class AtlasEntityStoreV2 implements AtlasEntityStore
{
AtlasEntityType entityType = (AtlasEntityType)
typeRegistry.getType(entity.getTypeName());
AtlasAttribute attr = entityType.getAttribute(attrName);
+ AtlasAuthorizationUtils.verifyAccess(new
AtlasEntityAccessRequest(typeRegistry, AtlasPrivilege.ENTITY_UPDATE, entity),
"update entity ByUniqueAttributes : guid=", guid );
+
if (attr == null) {
attr = entityType.getRelationshipAttribute(attrName,
AtlasEntityUtil.getRelationshipType(attrValue));