LuckPerms

LuckPerms

41.4k Downloads

Toggle for permission set

gecko10000 opened this issue ยท 4 comments

commented

Description

I have come upon multiple situations in which I would have liked to have something like /lp user (player) permission set (permission) toggle, where it would set the permission to the opposite of what it's set to.

Proposed behaviour

An option to put "toggle" in the command, which would switch around the permission in one command.

commented

Technically this is already a feature in the Web-editor and you can just quickly open the users web-editor with /lp user <name> editor and click the true|false button to toggle it.

I do understand having a toggle command for it though would be a little quicker. Something like /lp user|group <name> permission toggle <permission> and if the permission is not set, it will automatically add it and set it to true.

commented

My logic was integrating it with other plugins via command, and automatically, i.e. making a simple toggle for the multiple occasions I've needed it. Currently I have a JavaScript placeholder that does it, but having a toggle built into LP would be ideal.

commented

It seems to me that this is best done external to LP - it's a tossup whether toggle should automatically set to true or false or simply reject the command to being with, if the permission isn't present. For your use case, I'm not sure which would be best but I imagine it will vary depending on who uses it.

I'm happy to be overruled by anyone else, if there's some vital reason this should be within LP and not in an external plugin, it may be a worthy addition. Seems to me to just be a bit too specific? As a side note, if this is something a whole lot of people want (especially Luck), it would probably be best to make it a separate command to set or add, like lp user User permission toggle permission.here

commented

After some internal discussion, it seems that this is indeed out of scope of the main LP plugin - it's fairly trivial to implement this in code elsewhere and doesn't seem necessary or particularly useful in cases that don't simply abuse what permissions are intended to be used for.

Thank you for the idea nonetheless!