Skip to content

Commit 3e7900f

Browse files
authored
BE: Wizard: Fix nullable cluster perms check (#678)
1 parent e7df880 commit 3e7900f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

api/src/main/java/io/kafbat/ui/service/rbac/AccessControlService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ private boolean isAccessible(AuthenticatedUser user, AccessContext context) {
113113
return context.isAccessible(getUserPermissions(user, context.cluster()));
114114
}
115115

116-
private List<Permission> getUserPermissions(AuthenticatedUser user, String clusterName) {
116+
private List<Permission> getUserPermissions(AuthenticatedUser user, @Nullable String clusterName) {
117117
return properties.getRoles()
118118
.stream()
119119
.filter(filterRole(user))
120-
.filter(role -> role.getClusters().stream().anyMatch(clusterName::equalsIgnoreCase))
120+
.filter(role -> clusterName == null || role.getClusters().stream().anyMatch(clusterName::equalsIgnoreCase))
121121
.flatMap(role -> role.getPermissions().stream())
122122
.toList();
123123
}

0 commit comments

Comments
 (0)