Fix VisibilityRequiredVoter type check

This commit is contained in:
Nassim Jahnke 2023-08-25 21:25:04 +10:00
parent 2195a43a01
commit a5635982a1

View File

@ -34,8 +34,11 @@ public class VisibilityRequiredVoter extends HangarDecisionVoter<VisibilityRequi
switch (attribute.type()) {
case PROJECT:
if (arguments.length == 1) {
if (arguments[0] instanceof String slug && this.projectService.getProjectTable(slug) != null
|| this.projectService.getProjectTable((long) arguments[0]) != null) {
if (arguments[0] instanceof String slug) {
if (this.projectService.getProjectTable(slug) != null) {
return ACCESS_GRANTED;
}
} else if (this.projectService.getProjectTable((long) arguments[0]) != null) {
return ACCESS_GRANTED;
}
} else {