mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
Deny permission to use a command if no permission is set
Having no permission is almost always a bug. We already have behaviour elsewhere in the core that assumes undefined permission = permission denied. This behaviour might confuse some people, but I think it's much less dangerous than accidentally allowing everyone to use your command.
This commit is contained in:
parent
d891646d0a
commit
082f9e1647
@ -113,7 +113,7 @@ abstract class Command{
|
||||
public function testPermissionSilent(CommandSender $target, ?string $permission = null) : bool{
|
||||
$permission ??= $this->permission;
|
||||
if($permission === null || $permission === ""){
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach(explode(";", $permission) as $p){
|
||||
|
Loading…
x
Reference in New Issue
Block a user