You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by ni...@apache.org on 2019/12/06 09:34:54 UTC
[atlas] branch master updated: ATLAS-3550 :- Add authorize check
for partialUpdateEntityAttrByGuid API call
This is an automated email from the ASF dual-hosted git repository.
nixon 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 65a62b0 ATLAS-3550 :- Add authorize check for partialUpdateEntityAttrByGuid API call
65a62b0 is described below
commit 65a62b05369a2dbb75d26971dc071b28b1119331
Author: nixonrodrigues <ni...@apache.org>
AuthorDate: Fri Dec 6 14:49:21 2019 +0530
ATLAS-3550 :- Add authorize check for partialUpdateEntityAttrByGuid API call
---
.../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));