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 2022/05/02 20:45:33 UTC

[ranger] branch master updated: RANGER-3743: Add isDenyAllElse mapping to addCustomRangerDefaultPolicies method

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 7216423e0 RANGER-3743: Add isDenyAllElse mapping to addCustomRangerDefaultPolicies method
7216423e0 is described below

commit 7216423e0077ad290aaf6080fe1b5a1114716dd2
Author: Egyed Tamas <eg...@cloudera.com>
AuthorDate: Mon May 2 17:45:27 2022 +0200

    RANGER-3743: Add isDenyAllElse mapping to addCustomRangerDefaultPolicies method
    
    Signed-off-by: Madhan Neethiraj <ma...@apache.org>
---
 .../main/java/org/apache/ranger/plugin/service/RangerBaseService.java   | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/agents-common/src/main/java/org/apache/ranger/plugin/service/RangerBaseService.java b/agents-common/src/main/java/org/apache/ranger/plugin/service/RangerBaseService.java
index b04de9f7d..f8926a905 100644
--- a/agents-common/src/main/java/org/apache/ranger/plugin/service/RangerBaseService.java
+++ b/agents-common/src/main/java/org/apache/ranger/plugin/service/RangerBaseService.java
@@ -215,6 +215,7 @@ public abstract class RangerBaseService {
 	private void addCustomRangerDefaultPolicies(List<RangerPolicy> ret, Map<String, RangerPolicy.RangerPolicyResource> policyResourceMap, String policyPropertyPrefix) throws Exception {
 		String policyName  = configs.get(policyPropertyPrefix + PROP_DEFAULT_POLICY_NAME_SUFFIX);
 		String description = configs.get(policyPropertyPrefix + "description");
+		Boolean isDenyAllElse = Boolean.valueOf(configs.get(policyPropertyPrefix + "isDenyAllElse"));
 
 		if (StringUtils.isEmpty(description)) {
 			description = "Policy for " + policyName;
@@ -230,6 +231,7 @@ public abstract class RangerBaseService {
 		policy.setDescription(description);
 		policy.setName(policyName);
 		policy.setResources(policyResourceMap);
+		policy.setIsDenyAllElse(isDenyAllElse);
 
 		for (int i = 1; ; i++) {
 			String policyItemPropertyPrefix = policyPropertyPrefix + "policyItem." + i + ".";