mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 11:39:11 +03:00
Несколько стандартных PermissionsHandler
This commit is contained in:
parent
a606cb23e1
commit
291f6e4405
3 changed files with 28 additions and 0 deletions
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -30,6 +30,8 @@ public static String getHandlerName(Class clazz)
|
||||||
public static void registerHandlers() {
|
public static void registerHandlers() {
|
||||||
if (!registredHandl) {
|
if (!registredHandl) {
|
||||||
registerHandler("json", JsonFilePermissionsHandler.class);
|
registerHandler("json", JsonFilePermissionsHandler.class);
|
||||||
|
registerHandler("config", ConfigPermissionsHandler.class);
|
||||||
|
registerHandler("default", DefaultPermissionsHandler.class);
|
||||||
registredHandl = true;
|
registredHandl = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue