diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/ConfigPermissionsHandler.java b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/ConfigPermissionsHandler.java new file mode 100644 index 00000000..0e5ba896 --- /dev/null +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/ConfigPermissionsHandler.java @@ -0,0 +1,16 @@ +package ru.gravit.launchserver.auth.permissions; + +import ru.gravit.launchserver.auth.ClientPermissions; +import ru.gravit.launchserver.socket.Client; + +public class ConfigPermissionsHandler extends PermissionsHandler { + public boolean isAdmin = false; + public boolean isServer = false; + @Override + public ClientPermissions getPermissions(String username) { + ClientPermissions permissions = new ClientPermissions(); + permissions.canServer = isServer; + permissions.canAdmin = isAdmin; + return permissions; + } +} diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/DefaultPermissionsHandler.java b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/DefaultPermissionsHandler.java new file mode 100644 index 00000000..39c32310 --- /dev/null +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/DefaultPermissionsHandler.java @@ -0,0 +1,10 @@ +package ru.gravit.launchserver.auth.permissions; + +import ru.gravit.launchserver.auth.ClientPermissions; + +public class DefaultPermissionsHandler extends PermissionsHandler { + @Override + public ClientPermissions getPermissions(String username) { + return ClientPermissions.DEFAULT; + } +} diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/PermissionsHandler.java b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/PermissionsHandler.java index 5079eb07..6da71307 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/PermissionsHandler.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/PermissionsHandler.java @@ -30,6 +30,8 @@ public static String getHandlerName(Class clazz) public static void registerHandlers() { if (!registredHandl) { registerHandler("json", JsonFilePermissionsHandler.class); + registerHandler("config", ConfigPermissionsHandler.class); + registerHandler("default", DefaultPermissionsHandler.class); registredHandl = true; } }