SimpleCommandMap: Enforce command permissions by default (#4681)

this resolves many security issues, as well as removing a ton of boilerplate code.
It may be desirable to react to permission denied; this can be done by overriding Command->testPermission(), or by using setPermissionMessage() to set a custom permission denied message.
This commit is contained in:
Dylan T
2022-08-15 16:42:51 +01:00
committed by GitHub
parent 304bb84af2
commit 8e97e9dcda
42 changed files with 3 additions and 164 deletions

View File

@@ -43,10 +43,6 @@ final class PluginCommand extends Command implements PluginOwned{
return false;
}
if(!$this->testPermission($sender)){
return false;
}
$success = $this->executor->onCommand($sender, $this, $commandLabel, $args);
if(!$success && $this->usageMessage !== ""){