Skip to content

Commit

Permalink
[release-2.10] Fix the problem of creating PAT with hidden roles (#4808)
Browse files Browse the repository at this point in the history
This is an automated cherry-pick of #4800

/assign JohnNiang

```release-note
修复因部分角色导致无法正常创建个人令牌的问题
```
  • Loading branch information
halo-dev-bot authored Nov 1, 2023
1 parent 81e2c99 commit e075aba
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public Mono<Boolean> contains(Collection<String> source, Collection<String> cand
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));
Expand Down

0 comments on commit e075aba

Please sign in to comment.