获取用户资源逻辑修改
This commit is contained in:
@@ -27,9 +27,9 @@ public class AdminUserDetails implements UserDetails {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<? extends GrantedAuthority> getAuthorities() {
|
public Collection<? extends GrantedAuthority> getAuthorities() {
|
||||||
//返回当前用户的角色
|
//返回当前用户所拥有的资源
|
||||||
return resourceList.stream()
|
return resourceList.stream()
|
||||||
.map(role ->new SimpleGrantedAuthority(role.getId()+":"+role.getName()))
|
.map(resource ->new SimpleGrantedAuthority(resource.getId()+":"+resource.getName()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user