aikar / aikar/commands

Multiple command permissions doesn't work.

未關閉
#283 1 則留言 2 個 reaction 已指派 0 人 在 GitHub 檢視
core feature
主要語言
Java
星號
628
分支
150
PR 合併指標
30 天內沒有已合併 PR

描述

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.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。