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 <[email protected]>
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 <[email protected]>
---
.../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;