private User createUser(UserForm form, String profileId) { User user = new User(); user.setUserId(form.getUserName()); user.setProfileId(profileId); user.setTenantId(form.getTenantId()); user.setCreatedBy(form.getStaffFirstName() + " " + form.getStaffLastName()); user.setCreatedDate(new Date()); Role role = new Role(); role.setPrimary(STAFF_ROLE); role.setSecondary(form.getRole()); user.setRole(role); return user; }
private User createUser(CreateAccountForm createAccountForm, String profileId) { User user = new User(); user.setUserId(createAccountForm.getUserName()); user.setProfileId(profileId); user.setTenantId(createAccountForm.getTenantId()); user.setCreatedBy( createAccountForm.getStaffFirstName() + " " + createAccountForm.getStaffLastName()); user.setCreatedDate(new Date()); Role role = new Role(); role.setPrimary(CUSTOMER_ROLE); user.setRole(role); return user; }
/** * Change Password page load for staff * * @param tenantId * @param profileId * @return */ @RequestMapping(value = "/staffchangepassword", method = RequestMethod.GET) public ModelAndView changePassword( @RequestParam(value = "tenantid") String tenantId, @RequestParam(value = "profileid") String profileId) { log.debug("Entering...."); ChangePasswordForm form = new ChangePasswordForm(); ModelAndView modelAndView = new ModelAndView("staffchangepassword"); form.setTenantId(tenantId); form.setStaffProfileId(profileId); User user = loginService.getUserByProfileId(form.getTenantId(), form.getStaffProfileId()); if (user != null && user.getRole() != null) { Role role = user.getRole(); if (STAFF_ADMIN_ROLE.equals(role.getSecondary())) { modelAndView.addObject("role", STAFF_ADMIN_ROLE); } } modelAndView.addObject("form", form); log.debug("Existing.........."); return modelAndView; }