thomasmny / BuildSystem

Powerful, easy to use system for builders
https://buildsystem.eintosti.de
Other
35 stars 16 forks source link

Add individual permission check for `/settings` options #250

Open thomasmny opened 9 months ago

thomasmny commented 9 months ago

What problem does this feature solve?

Allows admins to block certain settings from being toggled

nicokempe commented 4 months ago

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;
thomasmny commented 4 months ago

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