diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/JsonFilePermissionsHandler.java b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/JsonFilePermissionsHandler.java index fb15aa7c..a2b837c5 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/JsonFilePermissionsHandler.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/JsonFilePermissionsHandler.java @@ -4,7 +4,6 @@ import ru.gravit.launcher.Launcher; import ru.gravit.launchserver.Reloadable; import ru.gravit.launchserver.auth.ClientPermissions; -import ru.gravit.launchserver.manangers.PermissionsManager; import ru.gravit.utils.helper.IOHelper; import ru.gravit.utils.helper.LogHelper; diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/provider/AuthProviderResult.java b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/provider/AuthProviderResult.java index d34f90c1..4432bb8d 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/provider/AuthProviderResult.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/provider/AuthProviderResult.java @@ -1,7 +1,7 @@ package ru.gravit.launchserver.auth.provider; +import ru.gravit.launchserver.LaunchServer; import ru.gravit.launchserver.auth.ClientPermissions; -import ru.gravit.launchserver.manangers.PermissionsManager; public class AuthProviderResult { @@ -12,7 +12,7 @@ public class AuthProviderResult { public AuthProviderResult(String username, String accessToken) { this.username = username; this.accessToken = accessToken; - permissions = PermissionsManager.getPermissions(username); + permissions = LaunchServer.server.config.permissionsHandler.getPermissions(username); } public AuthProviderResult(String username, String accessToken, ClientPermissions permissions) { diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/PermissionsManager.java b/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/PermissionsManager.java deleted file mode 100644 index ea5c75b7..00000000 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/PermissionsManager.java +++ /dev/null @@ -1,24 +0,0 @@ -package ru.gravit.launchserver.manangers; - -import ru.gravit.launchserver.auth.ClientPermissions; - -public class PermissionsManager { - private static PermissionsFunction function = PermissionsManager::returnDefault; - public static void registerPermissionsFunction(PermissionsFunction function) - { - PermissionsManager.function = function; - } - public static ClientPermissions getPermissions(String username) - { - return function.getPermission(username); - } - @FunctionalInterface - public interface PermissionsFunction - { - ClientPermissions getPermission(String username); - } - public static ClientPermissions returnDefault(String username) - { - return ClientPermissions.DEFAULT; - } -}