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 2023/05/22 15:45:00 UTC
[ranger] branch master updated: RANGER-4128: updated importTags API to use the service name specified in the URL for all service-resources
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 44a82e408 RANGER-4128: updated importTags API to use the service name specified in the URL for all service-resources
44a82e408 is described below
commit 44a82e4085f82e8b25428423a4dc881d9cbd2e94
Author: Siddhant Sontakke <si...@privacera.com>
AuthorDate: Fri May 12 19:42:31 2023 +0530
RANGER-4128: updated importTags API to use the service name specified in the URL for all service-resources
Signed-off-by: Madhan Neethiraj <ma...@apache.org>
---
.../src/main/java/org/apache/ranger/rest/PublicAPIsv2.java | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/security-admin/src/main/java/org/apache/ranger/rest/PublicAPIsv2.java b/security-admin/src/main/java/org/apache/ranger/rest/PublicAPIsv2.java
index 7f00e9dcb..69d2260de 100644
--- a/security-admin/src/main/java/org/apache/ranger/rest/PublicAPIsv2.java
+++ b/security-admin/src/main/java/org/apache/ranger/rest/PublicAPIsv2.java
@@ -32,6 +32,7 @@ import org.apache.ranger.plugin.model.RangerSecurityZoneHeaderInfo;
import org.apache.ranger.plugin.model.RangerService;
import org.apache.ranger.plugin.model.RangerServiceDef;
import org.apache.ranger.plugin.model.RangerServiceHeaderInfo;
+import org.apache.ranger.plugin.model.RangerServiceResource;
import org.apache.ranger.plugin.model.RangerServiceTags;
import org.apache.ranger.plugin.util.GrantRevokeRoleRequest;
import org.apache.ranger.plugin.util.ServiceTags;
@@ -648,6 +649,13 @@ public class PublicAPIsv2 {
logger.debug("==> PublicAPIsv2.importServiceTags()");
}
+ // overwrite serviceName with the one given in url
+ if (svcTags.getServiceResources() != null) {
+ for (RangerServiceResource svcResource : svcTags.getServiceResources()) {
+ svcResource.setServiceName(serviceName);
+ }
+ }
+
ServiceTags serviceTags = RangerServiceTags.toServiceTags(svcTags);
// overwrite serviceName with the one given in url