From 5709af5c0ade33aff357650fd4e57f79c4844649 Mon Sep 17 00:00:00 2001 From: Petr Ilin Date: Mon, 23 Jan 2023 22:55:42 +0300 Subject: Ability to deny/allow commands without permission plugins --- src/main/java/net/elytrium/limboauth/Settings.java | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src/main/java/net/elytrium/limboauth/Settings.java') diff --git a/src/main/java/net/elytrium/limboauth/Settings.java b/src/main/java/net/elytrium/limboauth/Settings.java index b83341a..17d5782 100644 --- a/src/main/java/net/elytrium/limboauth/Settings.java +++ b/src/main/java/net/elytrium/limboauth/Settings.java @@ -28,6 +28,7 @@ import net.elytrium.commons.config.YamlConfig; import net.elytrium.commons.kyori.serialization.Serializers; import net.elytrium.limboapi.api.chunk.Dimension; import net.elytrium.limboapi.api.player.GameMode; +import net.elytrium.limboauth.command.CommandPermissionState; import net.elytrium.limboauth.dependencies.DatabaseLibrary; import net.elytrium.limboauth.migration.MigrationHash; import net.kyori.adventure.bossbar.BossBar; @@ -286,6 +287,37 @@ public class Settings extends YamlConfig { } } + @Create + public MAIN.COMMAND_PERMISSION_STATE COMMAND_PERMISSION_STATE; + + @Comment({ + "Available values: FALSE, TRUE, PERMISSION", + " FALSE - the command will be disallowed", + " TRUE - the command will be allowed if player has false permission state", + " PERMISSION - the command will be allowed if player has true permission state" + }) + public static class COMMAND_PERMISSION_STATE { + @Comment("Permission: limboauth.commands.changepassword") + public CommandPermissionState CHANGE_PASSWORD = CommandPermissionState.PERMISSION; + @Comment("Permission: limboauth.commands.destroysession") + public CommandPermissionState DESTROY_SESSION = CommandPermissionState.PERMISSION; + @Comment("Permission: limboauth.commands.premium") + public CommandPermissionState PREMIUM = CommandPermissionState.PERMISSION; + @Comment("Permission: limboauth.commands.totp") + public CommandPermissionState TOTP = CommandPermissionState.PERMISSION; + @Comment("Permission: limboauth.commands.unregister") + public CommandPermissionState UNREGISTER = CommandPermissionState.PERMISSION; + + @Comment("Permission: limboauth.admin.forcechangepassword") + public CommandPermissionState FORCE_CHANGE_PASSWORD = CommandPermissionState.PERMISSION; + @Comment("Permission: limboauth.admin.forceunregister") + public CommandPermissionState FORCE_UNREGISTER = CommandPermissionState.PERMISSION; + @Comment("Permission: limboauth.admin.reload") + public CommandPermissionState RELOAD = CommandPermissionState.PERMISSION; + @Comment("Permission: limboauth.admin.help") + public CommandPermissionState HELP = CommandPermissionState.TRUE; + } + /* @Create public Settings.MAIN.EVENTS_PRIORITIES EVENTS_PRIORITIES; -- cgit