aikar / aikar/commands

Multiple command permissions doesn't work.

Aperta
#283 1 commento 2 reazioni 0 assegnatari Vedi su GitHub
core feature
Lingua principale
Java
Stelle
628
Fork
150
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Looking through the code, I found a snippet of code in [CommandParameter.java](https://github.com/aikar/commands/blob/master/core/src/main/java/co/aikar/commands/CommandParameter.java#L148) 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](https://github.com/aikar/commands/blob/26b35b830945c18b0387cdba42aea1af5ea7952d/core/src/main/java/co/aikar/commands/CommandManager.java#L305), 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](https://github.com/aikar/commands/blob/26b35b830945c18b0387cdba42aea1af5ea7952d/core/src/main/java/co/aikar/commands/BaseCommand.java#L808) has a method for checking if the command has any permission, and the [RootCommand](https://github.com/aikar/commands/blob/26b35b830945c18b0387cdba42aea1af5ea7952d/core/src/main/java/co/aikar/commands/RootCommand.java#L72) 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.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.