Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple command permissions doesn't work. #283

Open
Sven65 opened this issue Jul 31, 2020 · 1 comment
Open

Multiple command permissions doesn't work. #283

Sven65 opened this issue Jul 31, 2020 · 1 comment
Labels
core Related to the ACF Core feature

Comments

@Sven65
Copy link

Sven65 commented Jul 31, 2020

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.

@armeetj
Copy link

armeetj commented Jan 3, 2021

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.

@chickeneer chickeneer added feature core Related to the ACF Core labels Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Related to the ACF Core feature
Projects
None yet
Development

No branches or pull requests

3 participants