[BUG] Fix Deny List check order

This commit is contained in:
2023-10-29 18:48:33 +02:00
parent c248a94362
commit b0a0a551a0
2 changed files with 4 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
version_major=0
version_minor=0
version_patch=37
version_patch=39
shade_group=com.hypherionmc.sdlink.shaded.

View File

@@ -306,10 +306,7 @@ public class MinecraftAccount {
}
if (!SDLinkConfig.INSTANCE.accessControl.requiredRoles.isEmpty()) {
if (RoleManager.getVerificationRoles().isEmpty())
return Result.error("rolesNotLoaded");
if (!SDLinkConfig.INSTANCE.accessControl.requiredRoles.isEmpty() || ! SDLinkConfig.INSTANCE.accessControl.deniedRoles.isEmpty()) {
Profiler profiler = Profiler.getProfiler("checkRequiredRoles");
profiler.start("Checking Required Roles");
AtomicBoolean anyFound = new AtomicBoolean(false);
@@ -330,10 +327,10 @@ public class MinecraftAccount {
}));
profiler.stop();
if (deniedFound.get())
if (deniedFound.get() && !RoleManager.getDeniedRoles().isEmpty())
return Result.error("accessDeniedByRole");
if (!anyFound.get())
if (!anyFound.get() && !RoleManager.getVerificationRoles().isEmpty())
return Result.error("rolesNotFound");
if (member.isEmpty())