Skip to content

Commit

Permalink
BE: RBAC: Ignore values for non-applicable resources
Browse files Browse the repository at this point in the history
  • Loading branch information
wernerdv committed Sep 20, 2024
1 parent 025c41a commit 31061c0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/src/main/java/io/kafbat/ui/model/rbac/AccessContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ public boolean isAccessible(List<Permission> userPermissions) throws AccessDenie
if (name == null && permission.getCompiledValuePattern() == null) {
return true;
}
Preconditions.checkState(permission.getCompiledValuePattern() != null && name != null);
return permission.getCompiledValuePattern().matcher(name).matches();
if (permission.getCompiledValuePattern() != null && name != null) {
return permission.getCompiledValuePattern().matcher(name).matches();
}
return false;
})
.flatMap(p -> p.getParsedActions().stream())
.collect(Collectors.toSet());
Expand Down

0 comments on commit 31061c0

Please sign in to comment.