pocketmine\command\Command::testPermissionSilent PHP Method

testPermissionSilent() public method

public testPermissionSilent ( pocketmine\command\CommandSender $target ) : boolean
$target pocketmine\command\CommandSender
return boolean
    public function testPermissionSilent(CommandSender $target)
    {
        if ($this->permission === null or $this->permission === "") {
            return true;
        }
        foreach (explode(";", $this->permission) as $permission) {
            if ($target->hasPermission($permission)) {
                return true;
            }
        }
        return false;
    }

Usage Example

 public function testPermissionSilent(CommandSender $sender)
 {
     if ($sender instanceof Position) {
         if ($this->getName() === "f" and !$this->main->isFactionWorld($sender->getLevel()->getName())) {
             return false;
         }
     }
     return parent::testPermissionSilent($sender);
 }
All Usage Examples Of pocketmine\command\Command::testPermissionSilent