alternative to GrantedAuthorityImpl() class

The class GrantedAuthorityImpl has been deprecated – you can use SimpleGrantedAuthority instead:

public Collection<GrantedAuthority> getAuthorities(Integer access) {
    List<GrantedAuthority> authList = new ArrayList<GrantedAuthority>(2);

    if (access.compareTo(1) == 0) {
        authList.add(new SimpleGrantedAuthority("ROLE_ADMIN"));
    }
    else{
        authList.add(new SimpleGrantedAuthority("ROLE_USER"));
    }
    return authList;
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)