79291670

Date: 2024-12-18 15:41:26
Score: 1
Natty:
Report link

Solved changed the getAuthorities method as follow:

public List<SimpleGrantedAuthority> getAuthorities() {
        List<SimpleGrantedAuthority> authorities = new ArrayList<>(getPermissions()
                .stream()
                .map(permission -> new SimpleGrantedAuthority(permission.getName()))
                .toList());
        authorities.add(new SimpleGrantedAuthority("ROLE_" + this.name));

        return authorities;
    }
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Francesco Girardi