mirror of https://github.com/halo-dev/halo
Fix the problem of creating PAT with hidden roles (#4800)
#### What type of PR is this? /kind bug /area core /milestone 2.11.x #### What this PR does / why we need it: Fix the problem that we will encounter "insufficient roles" error while creating PAT with hidden roles. #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/4783 #### Does this PR introduce a user-facing change? ```release-note 修复因部分角色导致无法正常创建个人令牌的问题 ```pull/4804/head^2
parent
f2d7376d9f
commit
dcf099691f
|
@ -54,7 +54,7 @@ public class DefaultRoleService implements RoleService {
|
|||
if (source.contains(SuperAdminInitializer.SUPER_ROLE_NAME)) {
|
||||
return Mono.just(true);
|
||||
}
|
||||
return listDependencies(new HashSet<>(source), shouldFilterHidden(true))
|
||||
return listDependencies(new HashSet<>(source), shouldFilterHidden(false))
|
||||
.map(role -> role.getMetadata().getName())
|
||||
.collect(Collectors.toSet())
|
||||
.map(roleNames -> roleNames.containsAll(candidates));
|
||||
|
|
Loading…
Reference in New Issue