BuildSystem icon indicating copy to clipboard operation
BuildSystem copied to clipboard

Add individual permission check for `/settings` options

Open thomasmny opened this issue 1 year ago • 2 comments

What problem does this feature solve?

Allows admins to block certain settings from being toggled

thomasmny avatar Feb 13 '24 09:02 thomasmny

Do you mean something like this for the SettingsInventory at the InventoryClickEvent?

case 13:
    if (!player.hasPermission("buildsystem.settings.disableinteract")) {
        player.sendMessage(ChatColor.RED + "You do not have permission to toggle this setting.");
        return;
    }
    settings.setDisableInteract(!settings.isDisableInteract());
    break;

nicokempe avatar Jun 22 '24 18:06 nicokempe

yes, but I'd also like to display whether or not a player is even allowed to modify the setting https://github.com/thomasmny/BuildSystem/blob/571ece79cc834d3efe19130a99e9a70e70c7a049/buildsystem-core/src/main/java/de/eintosti/buildsystem/world/modification/CreateInventory.java#L114

thomasmny avatar Jun 23 '24 07:06 thomasmny