@Test public void test39gjUserToUserProfile() { VXPortalUser vXPortalUser = new VXPortalUser(); XXPortalUser xXPortalUser = new XXPortalUser(); userMgr.gjUserToUserProfile(xXPortalUser,vXPortalUser); }
protected void gjUserToUserProfile(XXPortalUser user, VXPortalUser userProfile) { UserSessionBase sess = ContextUtil.getCurrentUserSession(); if (sess == null) { return; } if (sess.isUserAdmin() || sess.isKeyAdmin() || sess.getXXPortalUser().getId().equals(user.getId())) { userProfile.setLoginId(user.getLoginId()); userProfile.setStatus(user.getStatus()); userProfile.setUserRoleList(new ArrayList<String>()); String emailAddress = user.getEmailAddress(); if (emailAddress != null && stringUtil.validateEmail(emailAddress)) { userProfile.setEmailAddress(user.getEmailAddress()); } userProfile.setUserSource(sess.getAuthProvider()); List<XXPortalUserRole> gjUserRoleList = daoManager .getXXPortalUserRole().findByParentId(user.getId()); for (XXPortalUserRole gjUserRole : gjUserRoleList) { userProfile.getUserRoleList().add(gjUserRole.getUserRole()); } userProfile.setId(user.getId()); List<XXUserPermission> xUserPermissions = daoManager .getXXUserPermission().findByUserPermissionIdAndIsAllowed( userProfile.getId()); List<XXGroupPermission> xxGroupPermissions = daoManager .getXXGroupPermission().findbyVXPortalUserId( userProfile.getId()); List<VXGroupPermission> groupPermissions = new ArrayList<VXGroupPermission>(); List<VXUserPermission> vxUserPermissions = new ArrayList<VXUserPermission>(); for (XXGroupPermission xxGroupPermission : xxGroupPermissions) { VXGroupPermission groupPermission = xGroupPermissionService .populateViewBean(xxGroupPermission); groupPermission.setModuleName(daoManager.getXXModuleDef() .findByModuleId(groupPermission.getModuleId()) .getModule()); groupPermissions.add(groupPermission); } for (XXUserPermission xUserPermission : xUserPermissions) { VXUserPermission vXUserPermission = xUserPermissionService .populateViewBean(xUserPermission); vXUserPermission.setModuleName(daoManager.getXXModuleDef() .findByModuleId(vXUserPermission.getModuleId()) .getModule()); vxUserPermissions.add(vXUserPermission); } userProfile.setGroupPermissions(groupPermissions); userProfile.setUserPermList(vxUserPermissions); userProfile.setFirstName(user.getFirstName()); userProfile.setLastName(user.getLastName()); userProfile.setPublicScreenName(user.getPublicScreenName()); } }
UserMgr { protected void gjUserToUserProfile(XXPortalUser user, VXPortalUser userProfile) { UserSessionBase sess = ContextUtil.getCurrentUserSession(); if (sess == null) { return; } if (sess.isUserAdmin() || sess.isKeyAdmin() || sess.getXXPortalUser().getId().equals(user.getId())) { userProfile.setLoginId(user.getLoginId()); userProfile.setStatus(user.getStatus()); userProfile.setUserRoleList(new ArrayList<String>()); String emailAddress = user.getEmailAddress(); if (emailAddress != null && stringUtil.validateEmail(emailAddress)) { userProfile.setEmailAddress(user.getEmailAddress()); } userProfile.setUserSource(sess.getAuthProvider()); List<XXPortalUserRole> gjUserRoleList = daoManager .getXXPortalUserRole().findByParentId(user.getId()); for (XXPortalUserRole gjUserRole : gjUserRoleList) { userProfile.getUserRoleList().add(gjUserRole.getUserRole()); } userProfile.setId(user.getId()); List<XXUserPermission> xUserPermissions = daoManager .getXXUserPermission().findByUserPermissionIdAndIsAllowed( userProfile.getId()); List<XXGroupPermission> xxGroupPermissions = daoManager .getXXGroupPermission().findbyVXPortalUserId( userProfile.getId()); List<VXGroupPermission> groupPermissions = new ArrayList<VXGroupPermission>(); List<VXUserPermission> vxUserPermissions = new ArrayList<VXUserPermission>(); for (XXGroupPermission xxGroupPermission : xxGroupPermissions) { VXGroupPermission groupPermission = xGroupPermissionService .populateViewBean(xxGroupPermission); groupPermission.setModuleName(daoManager.getXXModuleDef() .findByModuleId(groupPermission.getModuleId()) .getModule()); groupPermissions.add(groupPermission); } for (XXUserPermission xUserPermission : xUserPermissions) { VXUserPermission vXUserPermission = xUserPermissionService .populateViewBean(xUserPermission); vXUserPermission.setModuleName(daoManager.getXXModuleDef() .findByModuleId(vXUserPermission.getModuleId()) .getModule()); vxUserPermissions.add(vXUserPermission); } userProfile.setGroupPermissions(groupPermissions); userProfile.setUserPermList(vxUserPermissions); userProfile.setFirstName(user.getFirstName()); userProfile.setLastName(user.getLastName()); userProfile.setPublicScreenName(user.getPublicScreenName()); } } }
UserMgr { protected void gjUserToUserProfile(XXPortalUser user, VXPortalUser userProfile) { UserSessionBase sess = ContextUtil.getCurrentUserSession(); if (sess == null) { return; } if (sess.isUserAdmin() || sess.isKeyAdmin() || sess.getXXPortalUser().getId().equals(user.getId())) { userProfile.setLoginId(user.getLoginId()); userProfile.setStatus(user.getStatus()); userProfile.setUserRoleList(new ArrayList<String>()); String emailAddress = user.getEmailAddress(); if (emailAddress != null && stringUtil.validateEmail(emailAddress)) { userProfile.setEmailAddress(user.getEmailAddress()); } userProfile.setUserSource(sess.getAuthProvider()); List<XXPortalUserRole> gjUserRoleList = daoManager .getXXPortalUserRole().findByParentId(user.getId()); for (XXPortalUserRole gjUserRole : gjUserRoleList) { userProfile.getUserRoleList().add(gjUserRole.getUserRole()); } userProfile.setId(user.getId()); List<XXUserPermission> xUserPermissions = daoManager .getXXUserPermission().findByUserPermissionIdAndIsAllowed( userProfile.getId()); List<XXGroupPermission> xxGroupPermissions = daoManager .getXXGroupPermission().findbyVXPortalUserId( userProfile.getId()); List<VXGroupPermission> groupPermissions = new ArrayList<VXGroupPermission>(); List<VXUserPermission> vxUserPermissions = new ArrayList<VXUserPermission>(); for (XXGroupPermission xxGroupPermission : xxGroupPermissions) { VXGroupPermission groupPermission = xGroupPermissionService .populateViewBean(xxGroupPermission); groupPermission.setModuleName(daoManager.getXXModuleDef() .findByModuleId(groupPermission.getModuleId()) .getModule()); groupPermissions.add(groupPermission); } for (XXUserPermission xUserPermission : xUserPermissions) { VXUserPermission vXUserPermission = xUserPermissionService .populateViewBean(xUserPermission); vXUserPermission.setModuleName(daoManager.getXXModuleDef() .findByModuleId(vXUserPermission.getModuleId()) .getModule()); vxUserPermissions.add(vXUserPermission); } userProfile.setGroupPermissions(groupPermissions); userProfile.setUserPermList(vxUserPermissions); userProfile.setFirstName(user.getFirstName()); userProfile.setLastName(user.getLastName()); userProfile.setPublicScreenName(user.getPublicScreenName()); } } UserMgr(); }
UserMgr { protected void gjUserToUserProfile(XXPortalUser user, VXPortalUser userProfile) { UserSessionBase sess = ContextUtil.getCurrentUserSession(); if (sess == null) { return; } if (sess.isUserAdmin() || sess.isKeyAdmin() || sess.getXXPortalUser().getId().equals(user.getId())) { userProfile.setLoginId(user.getLoginId()); userProfile.setStatus(user.getStatus()); userProfile.setUserRoleList(new ArrayList<String>()); String emailAddress = user.getEmailAddress(); if (emailAddress != null && stringUtil.validateEmail(emailAddress)) { userProfile.setEmailAddress(user.getEmailAddress()); } userProfile.setUserSource(sess.getAuthProvider()); List<XXPortalUserRole> gjUserRoleList = daoManager .getXXPortalUserRole().findByParentId(user.getId()); for (XXPortalUserRole gjUserRole : gjUserRoleList) { userProfile.getUserRoleList().add(gjUserRole.getUserRole()); } userProfile.setId(user.getId()); List<XXUserPermission> xUserPermissions = daoManager .getXXUserPermission().findByUserPermissionIdAndIsAllowed( userProfile.getId()); List<XXGroupPermission> xxGroupPermissions = daoManager .getXXGroupPermission().findbyVXPortalUserId( userProfile.getId()); List<VXGroupPermission> groupPermissions = new ArrayList<VXGroupPermission>(); List<VXUserPermission> vxUserPermissions = new ArrayList<VXUserPermission>(); for (XXGroupPermission xxGroupPermission : xxGroupPermissions) { VXGroupPermission groupPermission = xGroupPermissionService .populateViewBean(xxGroupPermission); groupPermission.setModuleName(daoManager.getXXModuleDef() .findByModuleId(groupPermission.getModuleId()) .getModule()); groupPermissions.add(groupPermission); } for (XXUserPermission xUserPermission : xUserPermissions) { VXUserPermission vXUserPermission = xUserPermissionService .populateViewBean(xUserPermission); vXUserPermission.setModuleName(daoManager.getXXModuleDef() .findByModuleId(vXUserPermission.getModuleId()) .getModule()); vxUserPermissions.add(vXUserPermission); } userProfile.setGroupPermissions(groupPermissions); userProfile.setUserPermList(vxUserPermissions); userProfile.setFirstName(user.getFirstName()); userProfile.setLastName(user.getLastName()); userProfile.setPublicScreenName(user.getPublicScreenName()); } } UserMgr(); XXPortalUser createUser(VXPortalUser userProfile, int userStatus,
			Collection<String> userRoleList); XXPortalUser createUser(XXPortalUser user, int userStatus,
			Collection<String> userRoleList); XXPortalUser createUser(VXPortalUser userProfile, int userStatus); XXPortalUser updateUser(VXPortalUser userProfile); boolean updateRoles(Long userId, Collection<String> rolesList); void setUserRoles(Long userId, List<VXString> vStringRolesList); VXResponse changePassword(VXPasswordChange pwdChange); VXPortalUser changeEmailAddress(XXPortalUser gjUser,
			VXPasswordChange changeEmail); VXPortalUser deactivateUser(XXPortalUser gjUser); VXPortalUser getUserProfile(Long id); VXPortalUser getUserProfileByLoginId(); VXPortalUser getUserProfileByLoginId(String loginId); XXPortalUser mapVXPortalUserToXXPortalUser(VXPortalUser userProfile); VXPortalUser mapXXPortalUserToVXPortalUser(XXPortalUser user,
			Collection<String> userRoleList); VXPortalUser mapXXPortalUserVXPortalUser(XXPortalUser user); XXPortalUser findByEmailAddress(String emailId); XXPortalUser findByLoginId(String loginId); @Transactional(readOnly = true, propagation = Propagation.REQUIRED) Collection<String> getRolesForUser(XXPortalUser user); VXPortalUserList searchUsers(SearchCriteria searchCriteria); boolean deleteUserRole(Long userId, String userRole); boolean deleteUserRole(Long userId, XXPortalUserRole gjUserRole); XXPortalUserRole addUserRole(Long userId, String userRole); void checkAccess(Long userId); void checkAccess(XXPortalUser gjUser); void checkAccessForUpdate(XXPortalUser gjUser); String encrypt(String loginId, String password); String encryptWithOlderAlgo(String loginId, String password); VXPortalUser createUser(VXPortalUser userProfile); VXPortalUser createDefaultAccountUser(VXPortalUser userProfile); boolean isUserInRole(Long userId, String role); XXPortalUser updateUserWithPass(VXPortalUser userProfile); @Transactional(readOnly = false, propagation = Propagation.REQUIRED) XXPortalUser updatePasswordInSHA256(String userName,String userPassword,boolean logAudits); void checkAdminAccess(); Collection<String> getRolesByLoginId(String loginId); @Transactional(readOnly = false, propagation = Propagation.REQUIRED) XXPortalUser updateOldUserName(String userLoginId,String newUserName, String currentPassword); }
UserMgr { protected void gjUserToUserProfile(XXPortalUser user, VXPortalUser userProfile) { UserSessionBase sess = ContextUtil.getCurrentUserSession(); if (sess == null) { return; } if (sess.isUserAdmin() || sess.isKeyAdmin() || sess.getXXPortalUser().getId().equals(user.getId())) { userProfile.setLoginId(user.getLoginId()); userProfile.setStatus(user.getStatus()); userProfile.setUserRoleList(new ArrayList<String>()); String emailAddress = user.getEmailAddress(); if (emailAddress != null && stringUtil.validateEmail(emailAddress)) { userProfile.setEmailAddress(user.getEmailAddress()); } userProfile.setUserSource(sess.getAuthProvider()); List<XXPortalUserRole> gjUserRoleList = daoManager .getXXPortalUserRole().findByParentId(user.getId()); for (XXPortalUserRole gjUserRole : gjUserRoleList) { userProfile.getUserRoleList().add(gjUserRole.getUserRole()); } userProfile.setId(user.getId()); List<XXUserPermission> xUserPermissions = daoManager .getXXUserPermission().findByUserPermissionIdAndIsAllowed( userProfile.getId()); List<XXGroupPermission> xxGroupPermissions = daoManager .getXXGroupPermission().findbyVXPortalUserId( userProfile.getId()); List<VXGroupPermission> groupPermissions = new ArrayList<VXGroupPermission>(); List<VXUserPermission> vxUserPermissions = new ArrayList<VXUserPermission>(); for (XXGroupPermission xxGroupPermission : xxGroupPermissions) { VXGroupPermission groupPermission = xGroupPermissionService .populateViewBean(xxGroupPermission); groupPermission.setModuleName(daoManager.getXXModuleDef() .findByModuleId(groupPermission.getModuleId()) .getModule()); groupPermissions.add(groupPermission); } for (XXUserPermission xUserPermission : xUserPermissions) { VXUserPermission vXUserPermission = xUserPermissionService .populateViewBean(xUserPermission); vXUserPermission.setModuleName(daoManager.getXXModuleDef() .findByModuleId(vXUserPermission.getModuleId()) .getModule()); vxUserPermissions.add(vXUserPermission); } userProfile.setGroupPermissions(groupPermissions); userProfile.setUserPermList(vxUserPermissions); userProfile.setFirstName(user.getFirstName()); userProfile.setLastName(user.getLastName()); userProfile.setPublicScreenName(user.getPublicScreenName()); } } UserMgr(); XXPortalUser createUser(VXPortalUser userProfile, int userStatus,
			Collection<String> userRoleList); XXPortalUser createUser(XXPortalUser user, int userStatus,
			Collection<String> userRoleList); XXPortalUser createUser(VXPortalUser userProfile, int userStatus); XXPortalUser updateUser(VXPortalUser userProfile); boolean updateRoles(Long userId, Collection<String> rolesList); void setUserRoles(Long userId, List<VXString> vStringRolesList); VXResponse changePassword(VXPasswordChange pwdChange); VXPortalUser changeEmailAddress(XXPortalUser gjUser,
			VXPasswordChange changeEmail); VXPortalUser deactivateUser(XXPortalUser gjUser); VXPortalUser getUserProfile(Long id); VXPortalUser getUserProfileByLoginId(); VXPortalUser getUserProfileByLoginId(String loginId); XXPortalUser mapVXPortalUserToXXPortalUser(VXPortalUser userProfile); VXPortalUser mapXXPortalUserToVXPortalUser(XXPortalUser user,
			Collection<String> userRoleList); VXPortalUser mapXXPortalUserVXPortalUser(XXPortalUser user); XXPortalUser findByEmailAddress(String emailId); XXPortalUser findByLoginId(String loginId); @Transactional(readOnly = true, propagation = Propagation.REQUIRED) Collection<String> getRolesForUser(XXPortalUser user); VXPortalUserList searchUsers(SearchCriteria searchCriteria); boolean deleteUserRole(Long userId, String userRole); boolean deleteUserRole(Long userId, XXPortalUserRole gjUserRole); XXPortalUserRole addUserRole(Long userId, String userRole); void checkAccess(Long userId); void checkAccess(XXPortalUser gjUser); void checkAccessForUpdate(XXPortalUser gjUser); String encrypt(String loginId, String password); String encryptWithOlderAlgo(String loginId, String password); VXPortalUser createUser(VXPortalUser userProfile); VXPortalUser createDefaultAccountUser(VXPortalUser userProfile); boolean isUserInRole(Long userId, String role); XXPortalUser updateUserWithPass(VXPortalUser userProfile); @Transactional(readOnly = false, propagation = Propagation.REQUIRED) XXPortalUser updatePasswordInSHA256(String userName,String userPassword,boolean logAudits); void checkAdminAccess(); Collection<String> getRolesByLoginId(String loginId); @Transactional(readOnly = false, propagation = Propagation.REQUIRED) XXPortalUser updateOldUserName(String userLoginId,String newUserName, String currentPassword);  }