public User saveDefault(User user) { System.out.println(SecurityContextHolder.getContext().getAuthentication()); String password = this.passwordEncoder.encode(user.getPassword()); user.setPassword(password); return this.accountRepository.save(user); }
/** * @param user * @return */ public User registerNewUser(User user) { String password = this.passwordEncoder.encode(user.getPassword()); user.setPassword(password); user.setProfile(this.findProfileByName("Usuário externo registrado")); return this.accountRepository.save(user); }
/** * @param user * @return */ @PreAuthorize("hasPermission(#principal,'" + SystemPermissions.USUARIOS_INSERT + "')") public User save(User user) { System.out.println(SecurityContextHolder.getContext().getAuthentication()); String password = this.passwordEncoder.encode(user.getPassword()); user.setPassword(password); return this.accountRepository.save(user); }