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 2015/01/21 01:01:37 UTC

incubator-ranger git commit: RANGER-203: removed RangerPolicyItemAccess.isAudited flag, as having this flag at this granular level might not be useful and would be difficult to manage.

Repository: incubator-ranger
Updated Branches:
  refs/heads/stack 1e590f35d -> 3493c02f3


RANGER-203: removed RangerPolicyItemAccess.isAudited flag, as having
this flag at this granular level might not be useful and would be
difficult to manage.

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

Branch: refs/heads/stack
Commit: 3493c02f3aab82ffdad52d65f8cfa9b01476c9f7
Parents: 1e590f3
Author: Madhan Neethiraj <ma...@apache.org>
Authored: Tue Jan 20 16:01:11 2015 -0800
Committer: Madhan Neethiraj <ma...@apache.org>
Committed: Tue Jan 20 16:01:11 2015 -0800

----------------------------------------------------------------------
 .../ranger/plugin/model/RangerPolicy.java       | 23 +++-----------------
 .../RangerDefaultPolicyEvaluator.java           |  6 +----
 2 files changed, 4 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/3493c02f/plugin-common/src/main/java/org/apache/ranger/plugin/model/RangerPolicy.java
----------------------------------------------------------------------
diff --git a/plugin-common/src/main/java/org/apache/ranger/plugin/model/RangerPolicy.java b/plugin-common/src/main/java/org/apache/ranger/plugin/model/RangerPolicy.java
index 2457ae1..a7239fe 100644
--- a/plugin-common/src/main/java/org/apache/ranger/plugin/model/RangerPolicy.java
+++ b/plugin-common/src/main/java/org/apache/ranger/plugin/model/RangerPolicy.java
@@ -576,20 +576,18 @@ public class RangerPolicy extends RangerBaseModelObject implements java.io.Seria
 
 		private String  type      = null;
 		private Boolean isAllowed = null;
-		private Boolean isAudited = null;
 
 		public RangerPolicyItemAccess() {
-			this(null, null, null);
+			this(null, null);
 		}
 
 		public RangerPolicyItemAccess(String type) {
-			this(type, null, null);
+			this(type, null);
 		}
 
-		public RangerPolicyItemAccess(String type, Boolean isAllowed, Boolean isAudited) {
+		public RangerPolicyItemAccess(String type, Boolean isAllowed) {
 			setType(type);
 			setIsAllowed(isAllowed);
-			setIsAudited(isAudited);
 		}
 
 		/**
@@ -620,20 +618,6 @@ public class RangerPolicy extends RangerBaseModelObject implements java.io.Seria
 			this.isAllowed = isAllowed == null ? Boolean.TRUE : isAllowed;
 		}
 
-		/**
-		 * @return the isAudited
-		 */
-		public Boolean getIsAudited() {
-			return isAudited;
-		}
-
-		/**
-		 * @param isAudited the isAudited to set
-		 */
-		public void setIsAudited(Boolean isAudited) {
-			this.isAudited = isAudited == null ? Boolean.TRUE : isAudited;
-		}
-
 		@Override
 		public String toString( ) {
 			StringBuilder sb = new StringBuilder();
@@ -647,7 +631,6 @@ public class RangerPolicy extends RangerBaseModelObject implements java.io.Seria
 			sb.append("RangerPolicyItemAccess={");
 			sb.append("type={").append(type).append("} ");
 			sb.append("isAllowed={").append(isAllowed).append("} ");
-			sb.append("isAudited={").append(isAudited).append("} ");
 			sb.append("}");
 
 			return sb;

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/3493c02f/plugin-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerDefaultPolicyEvaluator.java
----------------------------------------------------------------------
diff --git a/plugin-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerDefaultPolicyEvaluator.java b/plugin-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerDefaultPolicyEvaluator.java
index 37b39a6..8a66ae6 100644
--- a/plugin-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerDefaultPolicyEvaluator.java
+++ b/plugin-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerDefaultPolicyEvaluator.java
@@ -409,17 +409,13 @@ public class RangerDefaultPolicyEvaluator extends RangerAbstractPolicyEvaluator
 					RangerPolicyItemAccess impliedAccess = getAccess(policyItem, impliedGrant);
 
 					if(impliedAccess == null) {
-						impliedAccess = new RangerPolicyItemAccess(impliedGrant, access.getIsAllowed(), access.getIsAudited());
+						impliedAccess = new RangerPolicyItemAccess(impliedGrant, access.getIsAllowed());
 
 						policyItem.getAccesses().add(impliedAccess);
 					} else {
 						if(! impliedAccess.getIsAllowed()) {
 							impliedAccess.setIsAllowed(access.getIsAllowed());
 						}
-
-						if(! impliedAccess.getIsAudited()) {
-							impliedAccess.setIsAudited(access.getIsAudited());
-						}
 					}
 				}
 			}