Я хочу альтернативу GrantedAuthorityImpl() классу. Я хочу это в реализации безопасности spring. GrantedAuthorityImpl() класс Depricated.hence я хочу альтернативное решение для него.
Мой код:
public Collection<GrantedAuthority> getAuthorities(Integer access) {
List<GrantedAuthority> authList = new ArrayList<GrantedAuthority>(2);
if (access.compareTo(1) == 0) {
authList.add(new GrantedAuthorityImpl("ROLE_ADMIN"));
}
else{
authList.add(new GrantedAuthorityImpl("ROLE_USER"));
}
return authList;
}