Determine if the given user can verify the given task.

@param User $user
@param Task $task

@return bool
960815
public function verify(UserPolicy $user, Task $task)
    {
        if ($user->canDo('task.task.verify') && $user->isAdmin()) {
            return true;
        }


        return false;
    }
1004863
public function verifyStartAuthorization($deliveryId, User $user)
    {
        foreach ($this->getProviders() as $provider) {
            $provider->verifyStartAuthorization($deliveryId, $user);
        }
    }
893154
protected function validateTaskResult(Result $result)
    {
        if ($result->getExitCode() !== Result::EXITCODE_OK) {
            throw new TaskResultRuntimeException($result);
        }

        return $result;
    }
543234
public function read(User $user, User $entity)
    {
        if ($entity->id === $user->id) {
            return true;
        }
        return $user->hasPermission('user-read');
    }
106543
protected function validateTask($taskObject)
    {
        try {
            if (!$taskObject->validate($msg)) {
                $this->log->warn("Task {$taskObject->getName()} is invalid.".
                    ($msg ? "\nError message: $msg" : '')
                );

                return false;
            }

            return true;
        } catch (MalformedConfigException $e) {
            $this->log->error("Error in task {$taskObject->getName()} configuration: ".
                $e->getMessage()
            );

            return false;
        }
    }
790997
public function userHasAccess(User $user)
    {
        if ($this->getWhitelisted() === false) {
            return true;
        }

        $criteria = Criteria::create()
                ->where(Criteria::expr()->eq('user', $user))
                ->setMaxResults(1);

        $serverUsers = $this->users->matching($criteria);
        if ($serverUsers->count() === 0) {
            return false;
        }

        $serverUser = $serverUsers->first();

        if ($serverUser->getBanned() === true) {
            return false;
        }

        if ($this->getRequiresApproval() === true && $serverUser->getApproved() === false) {
            return false;
        }

        return true;
    }
1078297
protected function runTaskOverSSH(Task $task)
    {
        // If the pretending option has been set, we'll simply dump the script out to the command
        // line so the developer can inspect it which is useful for just inspecting the script
        // before it is actually run against these servers. Allows checking for errors, etc.
        if ($this->pretending()) {
            echo $task->script.PHP_EOL;

            return 1;
        } else {
            return $this->passToRemoteProcessor($task);
        }
    }
1053741
public function exists(CanVerifyEmailContract $user, $token)
    {
        $email = $user->getEmailToVerify();

        $token = (array) $this->getTable()->where('email', $email)->where('token', $token)->first();

        return $token && ! $this->tokenExpired($token);
    }
1248861
public function isCallable($task)
    {
        // Check for container bindings
        if (is_array($task)) {
            return count($task) === 2 && ($this->container->has($task[0]) || is_callable($task));
        }

        return is_callable($task) && !$task instanceof Closure && !$task instanceof SerializableClosure;
    }
1015012
public function is_available(User $user)
    {
        return $this->app->getAclForUser($user)->has_right(\ACL::ORDER_MASTER);
    }
530869
public function addTask(Task $task)
    {
        if (!isset($this->tasks[$task->uniq])) {
            $this->tasks[$task->uniq] = $task;
            ++$this->tasksCount;
        }
    }
1125484
private static function isValidTask($task)
    {
        //====================================================================//
        // Verify Requested Object Type is Available
        if (empty($task->params)) {
            Splash::log()->err("Object Router - Missing Task Parameters... ");

            return false;
            //====================================================================//
        // Verify Requested Object Type is Available
        }
        if (empty($task->params->type)) {
            Splash::log()->err("Object Router - Missing Object Type... ");

            return false;
            //====================================================================//
        // Verify Requested Object Type is Valid
        }
        if (true != Splash::validate()->isValidObject($task->params->type)) {
            Splash::log()->err("Object Router - Object Type is Invalid... ");

            return false;
        }

        return true;
    }
762566
protected function can(string $action, ?Authorizable $user = null): bool
    {
        return ! \is_null($user)
                    ? $this->acl->canAs($user, $action)
                    : $this->acl->can($action);
    }
465827
public function validate(IUser $user): bool
    {
        if (null === $password = make(IPasswordRepository::class)->getByUser($user)) {
            return false;
        }

        return make(IPasswordHandler::class)->verify($this->password, $password->value());
    }
298712
public function isSatisfiedBy(User $user)
    {
        return $this->email === $user->email && password_verify($this->password, $user->password);
    }
984180
public function isBidder(User $user)
    {
        return (bool) $this->bids()->whereHas('bidder', function ($query) use ($user) {
            return $query->where('user_id', $user->userId);
        })->count();
    }
116293
public function verifyPassword(UserInterface $user, $password)
    {
        if (!$password) {
            return false;
        }

        $hashedPassword = $user->getHashedPassword();
        if (!$hashedPassword) {
            return false;
        }

        return password_verify($password, $hashedPassword);
    }