获取用户资源逻辑修改

This commit is contained in:
macro
2023-10-02 15:28:53 +08:00
parent 0d416f2902
commit 6c33602fae

View File

@@ -27,9 +27,9 @@ public class AdminUserDetails implements UserDetails {
@Override
public Collection<? extends GrantedAuthority> getAuthorities() {
//返回当前用户的角色
//返回当前用户所拥有的资源
return resourceList.stream()
.map(role ->new SimpleGrantedAuthority(role.getId()+":"+role.getName()))
.map(resource ->new SimpleGrantedAuthority(resource.getId()+":"+resource.getName()))
.collect(Collectors.toList());
}