You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by ma...@apache.org on 2020/03/06 22:18:06 UTC

[ranger] branch master updated: RANGER-2755: updated Atlas service-def and plugin for changes in ATLAS-3653

This is an automated email from the ASF dual-hosted git repository.

madhan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git


The following commit(s) were added to refs/heads/master by this push:
     new 0586ed0  RANGER-2755: updated Atlas service-def and plugin for changes in ATLAS-3653
0586ed0 is described below

commit 0586ed0b97ceecd5d7523377ee92b24093520c73
Author: Madhan Neethiraj <ma...@apache.org>
AuthorDate: Fri Mar 6 09:21:56 2020 -0800

    RANGER-2755: updated Atlas service-def and plugin for changes in ATLAS-3653
---
 .../main/resources/service-defs/ranger-servicedef-atlas.json | 12 ++++++------
 .../atlas/authorizer/RangerAtlasAuthorizer.java              |  8 ++++----
 .../org/apache/ranger/services/atlas/RangerServiceAtlas.java |  2 +-
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/agents-common/src/main/resources/service-defs/ranger-servicedef-atlas.json b/agents-common/src/main/resources/service-defs/ranger-servicedef-atlas.json
index 9355b71..f93d728 100644
--- a/agents-common/src/main/resources/service-defs/ranger-servicedef-atlas.json
+++ b/agents-common/src/main/resources/service-defs/ranger-servicedef-atlas.json
@@ -273,7 +273,7 @@
 		},
 		{
 			"itemId": 15,
-			"name": "entity-namespace",
+			"name": "entity-business-metadata",
 			"type": "string",
 			"level": 40,
 			"mandatory": true,
@@ -287,10 +287,10 @@
 				"wildCard": "true",
 				"ignoreCase": "true"
 			},
-			"label": "Namespace",
-			"description": "Namespace",
+			"label": "Business Metadata",
+			"description": "Business Metadata",
 			"accessTypeRestrictions": [
-				"entity-update-namespace"
+				"entity-update-business-metadata"
 			]
 		}
 	],
@@ -387,8 +387,8 @@
 		},
 		{
 			"itemId": 19,
-			"name": "entity-update-namespace",
-			"label": "Update Namespace"
+			"name": "entity-update-business-metadata",
+			"label": "Update Business Metadata"
 		}
 	],
 	"configs": [
diff --git a/plugin-atlas/src/main/java/org/apache/ranger/authorization/atlas/authorizer/RangerAtlasAuthorizer.java b/plugin-atlas/src/main/java/org/apache/ranger/authorization/atlas/authorizer/RangerAtlasAuthorizer.java
index ca06cf8..dc2ed8a 100644
--- a/plugin-atlas/src/main/java/org/apache/ranger/authorization/atlas/authorizer/RangerAtlasAuthorizer.java
+++ b/plugin-atlas/src/main/java/org/apache/ranger/authorization/atlas/authorizer/RangerAtlasAuthorizer.java
@@ -354,8 +354,8 @@ public class RangerAtlasAuthorizer implements AtlasAuthorizer {
 
             if (AtlasPrivilege.ENTITY_ADD_LABEL.equals(request.getAction()) || AtlasPrivilege.ENTITY_REMOVE_LABEL.equals(request.getAction())) {
                 rangerResource.setValue(RESOURCE_ENTITY_LABEL, request.getLabel());
-            } else if (AtlasPrivilege.ENTITY_UPDATE_NAMESPACE.equals(request.getAction())) {
-                rangerResource.setValue(RESOURCE_ENTITY_NAMESPACE, request.getNamespaceName());
+            } else if (AtlasPrivilege.ENTITY_UPDATE_BUSINESS_METADATA.equals(request.getAction())) {
+                rangerResource.setValue(RESOURCE_ENTITY_BUSINESS_METADATA, request.getBusinessMetadata());
             }
 
             if (StringUtils.isNotEmpty(classification)) {
@@ -468,8 +468,8 @@ public class RangerAtlasAuthorizer implements AtlasAuthorizer {
 
             if (AtlasPrivilege.ENTITY_ADD_LABEL.equals(request.getAction()) || AtlasPrivilege.ENTITY_REMOVE_LABEL.equals(request.getAction())) {
                 rangerResource.setValue(RESOURCE_ENTITY_LABEL, "label=" + request.getLabel());
-            } else if (AtlasPrivilege.ENTITY_UPDATE_NAMESPACE.equals(request.getAction())) {
-                rangerResource.setValue(RESOURCE_ENTITY_NAMESPACE, "namespace=" + request.getNamespaceName());
+            } else if (AtlasPrivilege.ENTITY_UPDATE_BUSINESS_METADATA.equals(request.getAction())) {
+                rangerResource.setValue(RESOURCE_ENTITY_BUSINESS_METADATA, "business-metadata=" + request.getBusinessMetadata());
             }
 
             auditEvents  = new HashMap<>();
diff --git a/plugin-atlas/src/main/java/org/apache/ranger/services/atlas/RangerServiceAtlas.java b/plugin-atlas/src/main/java/org/apache/ranger/services/atlas/RangerServiceAtlas.java
index d27cde3..7c89ffe 100644
--- a/plugin-atlas/src/main/java/org/apache/ranger/services/atlas/RangerServiceAtlas.java
+++ b/plugin-atlas/src/main/java/org/apache/ranger/services/atlas/RangerServiceAtlas.java
@@ -64,7 +64,7 @@ public class RangerServiceAtlas extends RangerBaseService {
 	public static final String RESOURCE_ENTITY_CLASSIFICATION         = "entity-classification";
 	public static final String RESOURCE_ENTITY_ID                     = "entity";
 	public static final String RESOURCE_ENTITY_LABEL                  = "entity-label";
-	public static final String RESOURCE_ENTITY_NAMESPACE              = "entity-namespace";
+	public static final String RESOURCE_ENTITY_BUSINESS_METADATA      = "entity-business-metadata";
 	public static final String RESOURCE_ENTITY_OWNER                  = "owner";
 	public static final String RESOURCE_RELATIONSHIP_TYPE             = "relationship-type";
 	public static final String RESOURCE_END_ONE_ENTITY_TYPE           = "end-one-entity-type";