You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by rm...@apache.org on 2019/08/26 23:20:30 UTC

[ranger] branch master updated: RANGER-2553:Hive RangerServiceDef isValidLeaf attribute values should not be copied to DataMaskDef and RowFilterDef

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

rmani 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 d8a056e  RANGER-2553:Hive RangerServiceDef isValidLeaf attribute values should not be copied to DataMaskDef and RowFilterDef
d8a056e is described below

commit d8a056e163011602e5722bb1a0293e0151047b1c
Author: rmani <rm...@hortonworks.com>
AuthorDate: Mon Aug 26 16:08:52 2019 -0700

    RANGER-2553:Hive RangerServiceDef isValidLeaf attribute values should not be copied to DataMaskDef and RowFilterDef
    
    Change-Id: Ie619dcfe24f7aee5a800e8b3e351e624829415d9
    
    Signed-off-by: rmani <rm...@hortonworks.com>
---
 .../java/org/apache/ranger/plugin/util/ServiceDefUtil.java   | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/agents-common/src/main/java/org/apache/ranger/plugin/util/ServiceDefUtil.java b/agents-common/src/main/java/org/apache/ranger/plugin/util/ServiceDefUtil.java
index e91fbff..596f5e8 100644
--- a/agents-common/src/main/java/org/apache/ranger/plugin/util/ServiceDefUtil.java
+++ b/agents-common/src/main/java/org/apache/ranger/plugin/util/ServiceDefUtil.java
@@ -311,7 +311,17 @@ public class ServiceDefUtil {
         if(CollectionUtils.isNotEmpty(delta.getAccessTypeRestrictions()))
             ret.setAccessTypeRestrictions(delta.getAccessTypeRestrictions());
 
-        if (delta.getIsValidLeaf() != null)
+        boolean copyLeafValue = false;
+        if (ret.getIsValidLeaf() != null) {
+            if (!ret.getIsValidLeaf().equals(delta.getIsValidLeaf())) {
+                copyLeafValue = true;
+            }
+        } else {
+            if (delta.getIsValidLeaf() != null) {
+                copyLeafValue = true;
+            }
+        }
+        if (copyLeafValue)
             ret.setIsValidLeaf(delta.getIsValidLeaf());
 
         return ret;