Skip to content

Commit

Permalink
Fix nullable cluster perms check. Fixes #677
Browse files Browse the repository at this point in the history
  • Loading branch information
Haarolean committed Nov 26, 2024
1 parent 9c028ed commit b8ea4ef
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ private boolean isAccessible(AuthenticatedUser user, AccessContext context) {
return context.isAccessible(getUserPermissions(user, context.cluster()));
}

private List<Permission> getUserPermissions(AuthenticatedUser user, String clusterName) {
private List<Permission> getUserPermissions(AuthenticatedUser user, @Nullable String clusterName) {
return properties.getRoles()
.stream()
.filter(filterRole(user))
.filter(role -> role.getClusters().stream().anyMatch(clusterName::equalsIgnoreCase))
.filter(role -> clusterName == null || role.getClusters().stream().anyMatch(clusterName::equalsIgnoreCase))
.flatMap(role -> role.getPermissions().stream())
.toList();
}
Expand Down

0 comments on commit b8ea4ef

Please sign in to comment.