ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ab...@apache.org
Subject ranger git commit: RANGER-1781: Policy model update to support restricted access-types based on selected resource
Date Sat, 18 Nov 2017 00:48:12 GMT
Repository: ranger
Updated Branches:
  refs/heads/master e65235d1c -> 81d1584a2


RANGER-1781: Policy model update to support restricted access-types based on selected resource


Project: http://git-wip-us.apache.org/repos/asf/ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/ranger/commit/81d1584a
Tree: http://git-wip-us.apache.org/repos/asf/ranger/tree/81d1584a
Diff: http://git-wip-us.apache.org/repos/asf/ranger/diff/81d1584a

Branch: refs/heads/master
Commit: 81d1584a2c8337e5fca81bf5cc237c3e66666e4e
Parents: e65235d
Author: Abhay Kulkarni <akulkarni@hortonworks.com>
Authored: Fri Nov 17 16:26:47 2017 -0800
Committer: Abhay Kulkarni <akulkarni@hortonworks.com>
Committed: Fri Nov 17 16:26:47 2017 -0800

----------------------------------------------------------------------
 .../validation/RangerServiceDefHelper.java      | 31 ++++++++++----------
 1 file changed, 15 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/81d1584a/agents-common/src/main/java/org/apache/ranger/plugin/model/validation/RangerServiceDefHelper.java
----------------------------------------------------------------------
diff --git a/agents-common/src/main/java/org/apache/ranger/plugin/model/validation/RangerServiceDefHelper.java
b/agents-common/src/main/java/org/apache/ranger/plugin/model/validation/RangerServiceDefHelper.java
index 6103e8f..486a39c 100644
--- a/agents-common/src/main/java/org/apache/ranger/plugin/model/validation/RangerServiceDefHelper.java
+++ b/agents-common/src/main/java/org/apache/ranger/plugin/model/validation/RangerServiceDefHelper.java
@@ -394,24 +394,23 @@ public class RangerServiceDefHelper {
 
             if (CollectionUtils.isEmpty(sources) || CollectionUtils.isEmpty(sinks)) {
                 ret = false;
-            } else if (_checkForCycles) {
-                List<String> cycle = graph.getACycle(sources, sinks);
-                if (cycle != null) {
-                    LOG.error("Graph contains cycle! - " + cycle);
-                    ret = false;
-                }
             } else {
-                for (String sink : sinks) {
-                    RangerResourceDef sinkResourceDef = resourceDefMap.get(sink);
-                    if (Boolean.FALSE.equals(sinkResourceDef.getIsValidLeaf())) {
-                        LOG.error("Error in path: sink node:[" + sink + "] is not leaf node");
-
-                        ret = false;
-                        break;
-                    } else if (sinkResourceDef.getIsValidLeaf() == null) {
-                        LOG.info("Setting sink ResourceDef's isValidLeaf from null to 'true'");
-                        sinkResourceDef.setIsValidLeaf(true);
+                List<String> cycle = _checkForCycles ? graph.getACycle(sources, sinks)
: null;
+                if (cycle == null) {
+                    for (String sink : sinks) {
+                        RangerResourceDef sinkResourceDef = resourceDefMap.get(sink);
+                        if (Boolean.FALSE.equals(sinkResourceDef.getIsValidLeaf())) {
+                            LOG.error("Error in path: sink node:[" + sink + "] is not leaf
node");
+                            ret = false;
+                            break;
+                        } else if (sinkResourceDef.getIsValidLeaf() == null) {
+                            LOG.info("Setting sink ResourceDef's isValidLeaf from null to
'true'");
+                            sinkResourceDef.setIsValidLeaf(true);
+                        }
                     }
+                } else {
+                    LOG.error("Graph contains cycle! - " + cycle);
+                    ret = false;
                 }
             }
 


Mime
View raw message