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

@ -47,10 +47,6 @@ class KillCommand extends VanillaCommand{
}
public function execute(CommandSender $sender, string $commandLabel, array $args){
if(!$this->testPermission($sender)){
return true;
}
if(count($args) >= 2){
throw new InvalidCommandSyntaxException();
}