@param User $requester

@return bool
357213
public function triggerDelete($requester)
    {
        $v = [$this->getUserID()];
        $pkr = new DeleteUserWorkflowRequest();
        $pkr->setRequestedUserID($this->getUserID());
        $pkr->setRequesterUserID($requester->getUserID());
        $pkr->trigger();

        return $this->connection->fetchColumn('select uID from Users where uID = ? limit 1', $v) ? false : true;
    }
473699
final public function isOwner(CM_Model_User $user = null) {
        try {
            return $this->getUser()->equals($user);
        } catch (CM_Exception_Nonexistent $ex) {
            return false;
        }
    }
1141988
public function has(User $user)
    {
        return $this->entries->exists(
            function ($key, $entry) use ($user) {
                return $entry->getUser()->getId() === $user->getId();
            }
        );
    }
930036
protected function getCallbackStatus(User $user): bool
    {
        $allCurrentNotificationFilter = $user->getBunqUser()->getNotificationFilters();

        /** @var NotificationFilter $filter */
        foreach ($allCurrentNotificationFilter as $filter) {
            if (
                self::NOTIFICATION_CATEGORY_MUTATION === $filter->getCategory()
                && self::NOTIFICATION_DELIVERY_METHOD_URL === $filter->getNotificationDeliveryMethod()
                && $filter->getNotificationTarget() === $this->getUrl()
            ) {
                return true;
            }
        }

        return false;
    }
835322
public function allowedUserGroupCheck($allowedUserGroups, $requestUserGroup) {
        $allowedUserGroupCheck = false;

        foreach ($requestUserGroup as $loginUserGroup) {
            if ( in_array($loginUserGroup, $allowedUserGroups) )
            {
                $allowedUserGroupCheck = true;
            }
        }
        return $allowedUserGroupCheck;
    }
1064962
public function isCacheable(Request $request, $user)
    {
        if (!$this->active) {
            return false;
        }

        if ($user) {
            return false;
        }

        if ($request->hasSession() && $request->getSession()->get('no_cache', false)) {
            $request->getSession()->remove('no_cache');

            return false;
        }

        if ($this->env != 'prod') {
            return false;
        }

        if ($request->getMethod() != 'GET') {
            return false;
        }

        return true;
    }
33352
public function delete(User $user, User $entity)
    {
        if ($entity->id === $user->id) {
            return true;
        }
        return $user->hasPermission('user-delete');
    }
253882
public function remove($user)
    {
        $this->load();
        if (!isset($this->users[$user])) {
            return false;
        }
        unset($this->users[$user]);
        return true;
    }
1320839
protected function canBeCalledWithUser($user, $class, $method = null)
    {
        if (! is_null($user)) {
            return true;
        }

        if (! is_null($method)) {
            return $this->methodAllowsGuests($class, $method);
        }

        if (is_array($class)) {
            $className = is_string($class[0]) ? $class[0] : get_class($class[0]);

            return $this->methodAllowsGuests($className, $class[1]);
        }

        return $this->callbackAllowsGuests($class);
    }
826337
public function remove(User $user) : bool
    {
        if (!$user->delete()) {
            throw new \RuntimeException($this->i18n->t('setrun/user', 'Removing error'));
        }
        return true;
    }
298712
public function isSatisfiedBy(User $user)
    {
        return $this->email === $user->email && password_verify($this->password, $user->password);
    }
458023
public function loadUser($user)
    {

        $now = time();
        $user->created = $now;
        $user->updated = $now;

        return true;

    }
38943
public function save($user)
    {
        $logger  = $GLOBALS['logger'];
        $path    = 'users/'.$user->getId();
        $request = $this->_remoteServer->post($path)
            ->setPostField('user', $user->serialize());
        try {
            $response = $request->send();
            return $response->getBody('true');
        } catch(\Guzzle\Http\Exception\BadResponseException $e) {
            $logger->info($e->getResponse()->getBody('true'), array());
            return false;
        }
    }
196570
public function isPublisher(User $user)
    {
        if ($this->publisher) {
            if ($this->publisher->getUser()->getId() === $user->getId()) {
                return true;
            }
        }

        return false;
    }
261204
public function isVisibleTo(User $user)
    {
        return (bool) $this->newQuery()->whereVisibleTo($user)->find($this->id);
    }
637781
public function hasAccess(array $url = [], array $user = []): bool
    {
        foreach ($this->getCheckRules() as $rule) {
            if (! class_exists($rule) || ! in_array(AccessInterface::class, class_implements($rule))) {
                throw new \InvalidArgumentException(sprintf('Unknown rule class: %s', $rule));
            }

            $result = (new $rule)->hasAccess($url, $user);

            if ($result) {
                return true;
            }
        }

        return false;
    }
1331320
public function view(User $user, Page $page)
    {

        if ($user->canDo('page.page.view')) {
            return true;
        }

        return $user->id == $page->user_id;
    }