@Secured({"ROLE_ADMIN", "ROLE_USER"}) @RequestMapping(value = "/api/profile/picture/update", method = RequestMethod.POST) public void updateProfilePicture(@RequestBody final Picture picture) { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); String email = authentication.getName(); pictureBean.create(picture); User user = userBean.findByEmail(email); user.setPicture(picture); userBean.update(user); }
@Secured({"ROLE_ADMIN", "ROLE_USER"}) @RequestMapping(value = "/api/profile/update", method = RequestMethod.POST) public void update(@RequestBody final User user) { userBean.update(user); }