@Secured("hasAnyRole('ROLE_PERM_access_sysadmin_screens')") @RequestMapping(value = "/admin/sys/userprofile/{id}", method = RequestMethod.POST) public String updateUserProfile( @ModelAttribute("userProfile") BindableSysAdminUserProfile bindableSysAdminUserProfile, Model model, Locale locale) { UserProfileEntityDTO userProfile = userProfileService.findWithCompany(bindableSysAdminUserProfile.getId()); String valid = "false"; if (bindableSysAdminUserProfile.getRemove() == 1) { userProfileService.removeProfile(bindableSysAdminUserProfile.getId()); return "redirect:/admin/sys/userprofiles"; } else { userProfileService.update(bindableSysAdminUserProfile); valid = "true"; } setDefaultFormData(model, locale, bindableSysAdminUserProfile, userProfile); model.addAttribute("valid", valid); return "sysAdminMain"; }
@Secured("hasAnyRole('ROLE_PERM_access_sysadmin_screens')") @RequestMapping(value = "/admin/sys/userprofile/{id}", method = RequestMethod.GET) public String getUserProfile(@PathVariable("id") Long id, Model model, Locale locale) { UserProfileEntityDTO userProfile = userProfileService.findWithCompany(id); BindableSysAdminUserProfile bindableSysAdminUserProfile = new BindableSysAdminUserProfile(); bindableSysAdminUserProfile.setId(userProfile.getId()); bindableSysAdminUserProfile.setEnabled(userProfile.isEnabled()); bindableSysAdminUserProfile.setEmail(userProfile.getEmail()); bindableSysAdminUserProfile.setCompanyId(userProfile.getCompany().getId()); setDefaultFormData(model, locale, bindableSysAdminUserProfile, userProfile); return "sysAdminMain"; }