ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sneet...@apache.org
Subject git commit: ARGUS-10: make knox service name mandatory - fixed
Date Wed, 27 Aug 2014 18:53:56 GMT
Repository: incubator-argus
Updated Branches:
  refs/heads/master 90f8628a9 -> 2003d3ae6


ARGUS-10: make knox service name mandatory - fixed


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

Branch: refs/heads/master
Commit: 2003d3ae647ba038b3ca1e318c55a5c554aeaf23
Parents: 90f8628
Author: sneethiraj <sneethir@apache.org>
Authored: Wed Aug 27 11:52:26 2014 -0700
Committer: sneethiraj <sneethir@apache.org>
Committed: Wed Aug 27 11:52:26 2014 -0700

----------------------------------------------------------------------
 .../webapp/scripts/views/knox/KnoxPolicyForm.js |  4 ++--
 .../main/webapp/scripts/views/users/UserForm.js | 20 +++++++++-----------
 2 files changed, 11 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/2003d3ae/security-admin/src/main/webapp/scripts/views/knox/KnoxPolicyForm.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/knox/KnoxPolicyForm.js b/security-admin/src/main/webapp/scripts/views/knox/KnoxPolicyForm.js
index 67190c9..b8a9a42 100644
--- a/security-admin/src/main/webapp/scripts/views/knox/KnoxPolicyForm.js
+++ b/security-admin/src/main/webapp/scripts/views/knox/KnoxPolicyForm.js
@@ -113,8 +113,8 @@ define(function(require){
 				},
 				services : {
 					type		: 'Select2Remote',
-					title		: localization.tt("lbl.selectServiceName"),
-					//validators  : [{type:'regexp',regexp:/^[a-zA-Z*?][a-zA-Z0-9_'&-/\$]*[A-Za-z0-9]*$/i,message
:localization.tt('validationMessages.enterValidName')}],
+					title		: localization.tt("lbl.selectServiceName")+' *',
+					validators  : ['required'],//[{type:'regexp',regexp:/^[a-zA-Z*?][a-zA-Z0-9_'&-/\$]*[A-Za-z0-9]*$/i,message
:localization.tt('validationMessages.enterValidName')}],
 					editorAttrs :{'data-placeholder': 'Select Service'},//'disabled' :'disabled'},
 					//fieldAttrs :{'disabled' :'disabled',},
 					pluginAttr  : this.getPlugginAttr(true,this.type.SERVICE)

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/2003d3ae/security-admin/src/main/webapp/scripts/views/users/UserForm.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/users/UserForm.js b/security-admin/src/main/webapp/scripts/views/users/UserForm.js
index c3d6a86..9ac83b7 100644
--- a/security-admin/src/main/webapp/scripts/views/users/UserForm.js
+++ b/security-admin/src/main/webapp/scripts/views/users/UserForm.js
@@ -131,15 +131,10 @@ define(function(require){
 					this.fields.userRoleList.editor.$el.attr('disabled',true);
 					
 				}
-				//User does not allowed to change his role (it's own role)
-				var userProfileModel = SessionMgr.getUserProfile();
-				if(this.model.get('name') == userProfileModel.get('loginId')){
-					this.fields.userRoleList.editor.$el.attr('disabled',true);
-				}
 				
-				if(userProfileModel.get('loginId') != "admin"){
-					if(this.model.get('loginId') != "admin"){
-						if(_.contains(userProfileModel.get('userRoleList'),'ROLE_SYS_ADMIN')){
+				if(SessionMgr.getUserProfile().get('loginId') != "admin"){
+					if(this.model.get('name') != "admin"){
+						if(_.contains(SessionMgr.getUserProfile().get('userRoleList'),'ROLE_SYS_ADMIN')){
 							this.fields.userRoleList.editor.$el.attr('disabled',false);
 						}else{
 							this.fields.userRoleList.editor.$el.attr('disabled',true);
@@ -150,8 +145,11 @@ define(function(require){
 				}else{
 					this.fields.userRoleList.editor.$el.attr('disabled',false);
 				}
-			}
-			
+				//User does not allowed to change his role (it's own role)
+				if(this.model.get('name') == SessionMgr.getUserProfile().get('loginId')){
+					this.fields.userRoleList.editor.$el.attr('disabled',true);
+				}
+			}			
 		},
 		renderCustomFields: function(){
 			var that = this;
@@ -245,4 +243,4 @@ define(function(require){
 	});
 
 	return UserForm;
-});
+});
\ No newline at end of file


Mime
View raw message