SimpleCommandMap: require commands to have a permission

fixes #5305
This commit is contained in:
Dylan K. Taylor 2023-02-13 14:24:30 +00:00
parent 082f9e1647
commit cb10360c20
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -139,6 +139,10 @@ class SimpleCommandMap implements CommandMap{
}
public function register(string $fallbackPrefix, Command $command, ?string $label = null) : bool{
if($command->getPermission() === null){
throw new \InvalidArgumentException("Commands must have a permission set");
}
if($label === null){
$label = $command->getLabel();
}