ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sneet...@apache.org
Subject [1/2] git commit: ARGUS-25: Fix to save policy when audit flag is OFF
Date Tue, 26 Aug 2014 02:45:04 GMT
Repository: incubator-argus
Updated Branches:
  refs/heads/master c89af3a14 -> 6cc76fdd7


ARGUS-25: Fix to save policy when audit flag is OFF


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

Branch: refs/heads/master
Commit: ecc9dbcafee71468dd21f140a13b42ac9087242e
Parents: f2034ba
Author: sneethiraj <sneethir@apache.org>
Authored: Mon Aug 25 15:50:57 2014 -0700
Committer: sneethiraj <sneethir@apache.org>
Committed: Mon Aug 25 15:50:57 2014 -0700

----------------------------------------------------------------------
 .../webapp/scripts/views/common/FormInputItemList.js    | 11 ++++-------
 .../webapp/scripts/views/common/UserPermissionList.js   | 12 +++++-------
 .../webapp/scripts/views/storm/StormPolicyCreate.js     |  2 +-
 3 files changed, 10 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/ecc9dbca/security-admin/src/main/webapp/scripts/views/common/FormInputItemList.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/common/FormInputItemList.js b/security-admin/src/main/webapp/scripts/views/common/FormInputItemList.js
index 2ac197b..73459ef 100644
--- a/security-admin/src/main/webapp/scripts/views/common/FormInputItemList.js
+++ b/security-admin/src/main/webapp/scripts/views/common/FormInputItemList.js
@@ -309,13 +309,10 @@ define(function(require) {
 		    		});
 		    		
 		    		if(that.model.has('_vPermList')){
-		    			var adminPerm = [];
-		    			adminPerm = _.where(that.model.get('_vPermList'),{'permType': XAEnums.XAPermType.XA_PERM_TYPE_ADMIN.value
});
-		    			if(_.isEmpty(adminPerm))
-		    				that.model.set('_vPermList', permTypeArr);
-		    			else
-		    				that.model.set('_vPermList', _.union(permTypeArr,adminPerm));
-					}
+                        var adminPerm = _.where(that.model.get('_vPermList'),{'permType':
XAEnums.XAPermType.XA_PERM_TYPE_ADMIN.value });
+                        permTypeArr = _.isEmpty(adminPerm) ? permTypeArr : _.union(permTypeArr,adminPerm);
+                    }
+                    that.model.set('_vPermList', permTypeArr);
 //		    		if(!_.isEmpty(perms))
 //		    			that.model.set('_vPermList', perms);
 //		    		that.model.set('_vPermList', permTypeArr);

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/ecc9dbca/security-admin/src/main/webapp/scripts/views/common/UserPermissionList.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/common/UserPermissionList.js b/security-admin/src/main/webapp/scripts/views/common/UserPermissionList.js
index 4611f49..518dbe2 100644
--- a/security-admin/src/main/webapp/scripts/views/common/UserPermissionList.js
+++ b/security-admin/src/main/webapp/scripts/views/common/UserPermissionList.js
@@ -318,13 +318,11 @@ define(function(require) {
 		    			}
 		    		});
 		    		if(that.model.has('_vPermList')){
-		    			var adminPerm = [];
-		    			adminPerm = _.where(that.model.get('_vPermList'),{'permType': XAEnums.XAPermType.XA_PERM_TYPE_ADMIN.value
});
-		    			if(_.isEmpty(adminPerm))
-		    				that.model.set('_vPermList', permTypeArr);
-		    			else
-		    				that.model.set('_vPermList', _.union(permTypeArr,adminPerm));
-					}
+                        var adminPerm = _.where(that.model.get('_vPermList'),{'permType':
XAEnums.XAPermType.XA_PERM_TYPE_ADMIN.value });
+                        permTypeArr = _.isEmpty(adminPerm) ? permTypeArr : _.union(permTypeArr,adminPerm);
+                    }
+                    that.model.set('_vPermList', permTypeArr);
+		    		
 		    		$(this).html(valArr.join(" "));
 			    },
 			});

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/ecc9dbca/security-admin/src/main/webapp/scripts/views/storm/StormPolicyCreate.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/storm/StormPolicyCreate.js b/security-admin/src/main/webapp/scripts/views/storm/StormPolicyCreate.js
index e4615b7..9fb769e 100644
--- a/security-admin/src/main/webapp/scripts/views/storm/StormPolicyCreate.js
+++ b/security-admin/src/main/webapp/scripts/views/storm/StormPolicyCreate.js
@@ -119,7 +119,7 @@ define(function(require){
 			valid = (validateObj.groupSet && validateObj.permSet && validateObj.groupIPSet)
|| (validateObj.userSet && validateObj.userPerm && validateObj.userIPSet);
 			if(!valid){
 				if(this.validateGroupPermission(validateObj)) {
-					 if((!validateObj.auditLoggin) && (!validateObj.groupPermSet)){
+					if((!validateObj.auditLoggin) && !(validateObj.groupPermSet || validateObj.userSet)){
 						XAUtil.alertPopup({
 							msg :localization.tt('msg.yourAuditLogginIsOff'),
 							callback : function(){}


Mime
View raw message