@Override public String saveTCAProfile(TCAProfileVO tcaProfile, boolean newUser) { ETSAdminUser adminUser = tcaProfile.getAdminUser(); Set<AdminPermission> permissionSet = new HashSet<AdminPermission>(); AdminPermission adminPermission = adminSecurityService.readAdminPermissionById(TCA_PERMISSION); permissionSet.add(adminPermission); adminUser.setAllPermissions(permissionSet); adminUser.setInternalUserFlag(true); ETSAdminUser updatedAdminUser = (ETSAdminUser) adminSecurityService.saveAdminUser(adminUser); updatedAdminUser.setEtsPhone(adminUser.getEtsPhone()); tcaProfile.setAdminUser(updatedAdminUser); savePhone(tcaProfile); // Integrate with EIAS String guidID = ""; if (eregUtils.isOAMAuthentication()) { if (newUser) { guidID = eiasWebServiceClient.createUser(adminUser); } else { eiasWebServiceClient.modifyUser(adminUser); } } if (newUser) { sendConfirmationEmail(tcaProfile); } // authenticate return guidID; }
@Override public boolean isUsernameAvailable(String userName) { boolean isAvailable = true; if (eregUtils.isOAMAuthentication()) { isAvailable = eiasWebServiceClient.searchUser(userName); } else { isAvailable = (null == etsAdminUserDao.readAdminUserByUserName(userName)); } return isAvailable; }