commands icon indicating copy to clipboard operation
commands copied to clipboard

Multiple command permissions doesn't work.

Open Sven65 opened this issue 5 years ago • 1 comments

Looking through the code, I found a snippet of code in CommandParameter.java that suggests it's possible to have a command with multiple permissions, i.e. the player can can have any of the permissions to execute the command, but using @CommandPermission("plugin.command.self,plugin.command.others") doesn't seem to be working.

Looking at CommandManager.java, it would seem that it's set to require the user to have all the permissions specified.

I don't know if this is a bug or intended behaviour, seeing as BaseCommand.java has a method for checking if the command has any permission, and the RootCommand has the same.

If it's indented, I'd suggest replacing the comma with the pipe (|), and making the comma for any permission, or the other way around.

Sven65 avatar Jul 31 '20 09:07 Sven65

Looking through the code, I found a snippet of code in CommandParameter.java that suggests it's possible to have a command with multiple permissions, i.e. the player can can have any of the permissions to execute the command, but using @CommandPermission("plugin.command.self,plugin.command.others") doesn't seem to be working.

Looking at CommandManager.java, it would seem that it's set to require the user to have all the permissions specified.

I don't know if this is a bug or intended behaviour, seeing as BaseCommand.java has a method for checking if the command has any permission, and the RootCommand has the same.

If it's indented, I'd suggest replacing the comma with the pipe (|), and making the comma for any permission, or the other way around.

Vouch, I was surprised to see this wasn't already a feature.

armeetj avatar Jan 03 '21 08:01 armeetj