ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sneet...@apache.org
Subject [1/5] git commit: ARGUS-142:Fixed no audit info shown for user role changes
Date Fri, 31 Oct 2014 21:02:23 GMT
Repository: incubator-argus
Updated Branches:
  refs/heads/argus2ranger eca811d21 -> a28f5f6b6


ARGUS-142:Fixed no audit info shown for user role changes

Signed-off-by: sneethiraj <sneethir@apache.org>


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

Branch: refs/heads/argus2ranger
Commit: e652492d6aa716e303e78a380bea3b126d39eca6
Parents: a519885
Author: vperiasamy <vperiasamy@hortonworks.com>
Authored: Thu Oct 30 16:12:37 2014 -0700
Committer: sneethiraj <sneethir@apache.org>
Committed: Thu Oct 30 18:13:53 2014 -0700

----------------------------------------------------------------------
 .../src/main/java/com/xasecure/biz/XUserMgr.java         |  1 +
 .../src/main/java/com/xasecure/service/XUserService.java |  3 +++
 .../webapp/scripts/views/reports/OperationDiffDetail.js  | 11 +++++++++++
 3 files changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/e652492d/security-admin/src/main/java/com/xasecure/biz/XUserMgr.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/com/xasecure/biz/XUserMgr.java b/security-admin/src/main/java/com/xasecure/biz/XUserMgr.java
index 123c2dd..45922a9 100644
--- a/security-admin/src/main/java/com/xasecure/biz/XUserMgr.java
+++ b/security-admin/src/main/java/com/xasecure/biz/XUserMgr.java
@@ -139,6 +139,7 @@ public class XUserMgr extends XUserMgrBase {
 		vXPortalUser.setFirstName(vXUser.getFirstName());
 		vXPortalUser.setLastName(vXUser.getLastName());
 		vXPortalUser.setEmailAddress(vXUser.getEmailAddress());
+		vXPortalUser.setPublicScreenName(vXUser.getFirstName() +" "+ vXUser.getLastName());
 		vXPortalUser.setPassword(actualPassword);
 		vXPortalUser.setUserRoleList(vXUser.getUserRoleList());
 		vXPortalUser = userMgr.createDefaultAccountUser(vXPortalUser);

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/e652492d/security-admin/src/main/java/com/xasecure/service/XUserService.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/com/xasecure/service/XUserService.java b/security-admin/src/main/java/com/xasecure/service/XUserService.java
index 6e7e392..3d8505a 100644
--- a/security-admin/src/main/java/com/xasecure/service/XUserService.java
+++ b/security-admin/src/main/java/com/xasecure/service/XUserService.java
@@ -83,6 +83,9 @@ public class XUserService extends XUserServiceBase<XXUser, VXUser>
{
 				"Email Address", false));
 		trxLogAttrs.put("password", new VTrxLogAttr("password", "Password",
 				false));
+		trxLogAttrs.put("userRoleList", new VTrxLogAttr("userRoleList", "User Role",
+				false));
+		
 	}
 
 	public XUserService() {

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/e652492d/security-admin/src/main/webapp/scripts/views/reports/OperationDiffDetail.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/reports/OperationDiffDetail.js b/security-admin/src/main/webapp/scripts/views/reports/OperationDiffDetail.js
index bd346d0..e13f6c3 100644
--- a/security-admin/src/main/webapp/scripts/views/reports/OperationDiffDetail.js
+++ b/security-admin/src/main/webapp/scripts/views/reports/OperationDiffDetail.js
@@ -355,6 +355,17 @@ define(function(require){
 					if(m.get('action') == 'delete' || m.get('action') == 'update')
 						that.previousGroupList.push(m.get('parentObjectName'));
 					modelArr.push(m);
+				}else if(m.get('attributeName') == 'User Role'){
+					var newRole =  m.get('newValue').replace(/[[\]]/g,'');
+					var prevRole = m.get('previousValue').replace(/[[\]]/g,'');
+					if( newRole == "ROLE_USER")
+						m.set('newValue',XAEnums.UserRoles.ROLE_USER.label)
+					else if(newRole == "ROLE_SYS_ADMIN")
+						m.set('newValue',XAEnums.UserRoles.ROLE_SYS_ADMIN.label)
+					if(prevRole == "ROLE_USER")
+						m.set('previousValue',XAEnums.UserRoles.ROLE_USER.label)
+					else if(prevRole == "ROLE_SYS_ADMIN")
+						m.set('previousValue',XAEnums.UserRoles.ROLE_SYS_ADMIN.label)
 				}else{
 					if(!m.has('attributeName'))
 						modelArr.push(m);


Mime
View raw message