fox noCasesDefined condition

This commit is contained in:
Michael Hoennig 2024-04-26 12:49:35 +02:00
parent e2b90a7429
commit 86a380758e

View File

@ -604,7 +604,7 @@ public class RbacView {
} }
boolean matchesCase(final ColumnValue requestedCase) { boolean matchesCase(final ColumnValue requestedCase) {
final var noCasesDefined = forCases == null || forCases.isEmpty(); final var noCasesDefined = forCases == null;
final var generateForAllCases = requestedCase == null; final var generateForAllCases = requestedCase == null;
final boolean isGrantedForRequestedCase = forCases == null || forCases.stream().anyMatch(c -> c.isCase(requestedCase)); final boolean isGrantedForRequestedCase = forCases == null || forCases.stream().anyMatch(c -> c.isCase(requestedCase));
return noCasesDefined || generateForAllCases || isGrantedForRequestedCase; return noCasesDefined || generateForAllCases || isGrantedForRequestedCase;