看到spring-security这个框架的盆友们,为啥老师不调用toUpperCase()都可以,而我不调用就没得权限,
public List<SimpleGrantedAuthority> getAuthority(List<Role> roles) {
List<SimpleGrantedAuthority> list = new ArrayList<>();
for (Role role : roles) {
list.add(new SimpleGrantedAuthority("ROLE_"+role.getRoleName().toUpperCase()));
}
return list;
}
|
|