Skip to content

Commit 31061c0

Browse files
committed
BE: RBAC: Ignore values for non-applicable resources
1 parent 025c41a commit 31061c0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

api/src/main/java/io/kafbat/ui/model/rbac/AccessContext.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,10 @@ public boolean isAccessible(List<Permission> userPermissions) throws AccessDenie
6969
if (name == null && permission.getCompiledValuePattern() == null) {
7070
return true;
7171
}
72-
Preconditions.checkState(permission.getCompiledValuePattern() != null && name != null);
73-
return permission.getCompiledValuePattern().matcher(name).matches();
72+
if (permission.getCompiledValuePattern() != null && name != null) {
73+
return permission.getCompiledValuePattern().matcher(name).matches();
74+
}
75+
return false;
7476
})
7577
.flatMap(p -> p.getParsedActions().stream())
7678
.collect(Collectors.toSet());

0 commit comments

Comments
 (0)