ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject ranger git commit: RANGER-1431:Do some code improvement in Java method AuthSessionService.mapEntityToViewBean
Date Wed, 03 May 2017 17:08:30 GMT
Repository: ranger
Updated Branches:
  refs/heads/ranger-0.7 4ff214e0b -> 0c7798f33


RANGER-1431:Do some code improvement in Java method AuthSessionService.mapEntityToViewBean

Signed-off-by: zhangqiang2 <zhangqiang2@zte.com.cn>
Signed-off-by: Colm O hEigeartaigh <coheigea@apache.org>


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

Branch: refs/heads/ranger-0.7
Commit: 0c7798f336ebb72da32d4ecc8d84c677dbb785ca
Parents: 4ff214e
Author: zhangqiang2 <zhangqiang2@zte.com.cn>
Authored: Wed Mar 8 10:03:14 2017 +0800
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Wed May 3 18:08:23 2017 +0100

----------------------------------------------------------------------
 .../apache/ranger/service/AuthSessionService.java   | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/0c7798f3/security-admin/src/main/java/org/apache/ranger/service/AuthSessionService.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/service/AuthSessionService.java
b/security-admin/src/main/java/org/apache/ranger/service/AuthSessionService.java
index 1e21870..249a695 100644
--- a/security-admin/src/main/java/org/apache/ranger/service/AuthSessionService.java
+++ b/security-admin/src/main/java/org/apache/ranger/service/AuthSessionService.java
@@ -169,14 +169,16 @@ public class AuthSessionService extends
 		viewObj.setRequestUserAgent(resource.getRequestUserAgent());
 
 		if (resource.getUserId() != null) {
-			XXPortalUser gjUser = daoMgr.getXXPortalUser().getById(resource.getUserId());
-			viewObj.setEmailAddress(gjUser.getEmailAddress());
-			viewObj.setFamilyScreenName(gjUser.getEmailAddress());
-			viewObj.setFirstName(gjUser.getFirstName());
-			viewObj.setLastName(gjUser.getLastName());
-			viewObj.setLastName(gjUser.getLastName());
-			viewObj.setPublicScreenName(gjUser.getPublicScreenName());
 			viewObj.setUserId(resource.getUserId());
+
+			XXPortalUser gjUser = daoMgr.getXXPortalUser().getById(resource.getUserId());
+			if (gjUser != null) {
+				viewObj.setEmailAddress(gjUser.getEmailAddress());
+				viewObj.setFamilyScreenName(gjUser.getLastName());
+				viewObj.setFirstName(gjUser.getFirstName());
+				viewObj.setLastName(gjUser.getLastName());
+				viewObj.setPublicScreenName(gjUser.getPublicScreenName());
+			}
 		}
 
 		return viewObj;


Mime
View raw message