Ejemplo n.º 1
0
  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);
  }
Ejemplo n.º 2
0
  /**
   * @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);
  }
Ejemplo n.º 3
0
  /**
   * @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);
  }