Check if a node authroize being updated.

@param AnCommandContext $context Context parameter

@return bool
322048
protected function _authorizeDelete($context)
    {
        $owneids = $this->_entity->getIds('owner');

        if (count($owneids) > 1) {
            return false;
        } elseif ($this->_viewer->admin()) {
            return true;
        } elseif ($this->_entity->owner->authorize('administration')) {
            return true;
        }

        return false;
    }
130467
protected function _authorizeAccess(AnCommandContext $context)
    {
        //if entity is not privatable then it doesn't have access to allow method
        if (!$this->_entity->isPrivatable()) {
            return true;
        }

        if ($this->_viewer->admin()) {
            return true;
        }

        if ($this->_entity->isFollowable() && $this->_entity->blocking($this->_viewer)) {
            return false;
        }

        if ($this->_entity->allows($this->_viewer, 'access')) {
            return true;
        }

        return false;
    }
1332986
protected function _authorizeBlock(AnCommandContext $context)
    {
        if (is_guest($this->_viewer)) {
            return false;
        }

        //viewer can only block actor from following them if and only if actor is leadable (can follow ) and viewer is followable
        if (!$this->_entity->isLeadable()) {
            return false;
        }

        if ($this->_viewer->eql($this->_entity)) {
            return false;
        }

        //you can't block an admin
        if ($this->_entity->admin()) {
            return false;
        }

         //if entity is administrable and the viewer is one of the admins then it can not be blocked
        if (
            $this->_entity->isAdministrable() &&
            $this->_entity->administratorIds->offsetExists($this->_viewer->id)
        ) {
            return false;
        }

        return true;
    }
476765
protected function _actionBlock(AnCommandContext $context)
    {
        $this->getResponse()->status = AnHttpResponse::RESET_CONTENT;
        $this->getItem()->addBlocker($this->actor);

        return $this->getItem();
    }
561667
protected function _actionDispatch(AnCommandContext $context)
    {
        if ($this->action === 'confirm' && $this->token) {
            $context->data->append(array(
               '_action' => 'confirm',
               'token' => $this->token,
            ));

            return $this->execute('post', $context);
        }

        return parent::_actionDispatch($context);
    }
48252
protected function _actionDelete(AnCommandContext $context)
    {
        if ($session = $this->actor->sessions->find(array('api' => $this->getIdentifier()->name))) {
            $session->delete()->save();
        }
    }
1232797
protected function _actionEditsubscription(AnCommandContext $context)
    {
        if ($subscription = $this->_subscriber->changeSubscriptionTo($this->getItem())) {
            $subscription->endDate = $context->data->endDate;
        }
    }
1334462
protected function _actionUnlead(AnCommandContext $context)
    {
        $this->getResponse()->status = AnHttpResponse::RESET_CONTENT;
        $this->getItem()->removeLeader($this->actor);

        return $this->getItem();
    }
1006533
protected function _actionAddsubscriber(AnCommandContext $context)
    {
        if ($subscription = $this->_subscriber->subscribeTo($this->getItem())) {
            $subscription->endDate = $context->data->endDate;
        }
    }
695319
protected function _actionDelete(AnCommandContext $context)
    {
        dispatch_plugin('user.onBeforeDeletePerson', array('data' => $context->data));

        $person = parent::_actionDelete($context);
        $person_id = $person->id;

        $this->getService('repos:sessions.session')->destroy(array('nodeId' => $person->id));

        dispatch_plugin('user.onAfterDeletePerson', array('id' => $person_id));

        return $person;
    }
783740
public function isGranted($permission, $context = null)
    {
        $roles = $this->roleService->getIdentityRoles();

        if (empty($roles)) {
            return false;
        }

        if (!$this->rbac->isGranted($roles, $permission)) {
            return false;
        }

        if ($this->hasAssertion($permission)) {
            return $this->assert($this->assertions[(string) $permission], $context);
        }

        return true;
    }
1137733
protected function _afterEntityUpdate(AnCommandContext $context)
    {
        $this->getSpace()->setEntityState($context->entity, AnDomain::STATE_UPDATED);
    }
1085449
public function appliesToContext(ContextInterface $context): bool
    {
        if (!$context instanceof ClientMethodContext) {
            return false;
        }

        $method = $context->getMethod();
        if (!preg_match($this->regex, $method->getMethodName())) {
            return false;
        }

        return $this->subRule->appliesToContext($context);
    }
1022378
protected function _beforeRepositoryFetch(AnCommandContext $context)
    {
        if ($this->_enable) {
            $key = $this->_getCacheKey($context->query);

            if (self::$_cache->offsetExists($key)) {
                $context->data = self::$_cache->offsetGet($key);

                return false;
            }
        }
    }
257028
public function mailConfirmation(AnCommandContext $context)
    {
        if ($this->person) {
            $settings = $this->getService('com:settings.setting');
            $mails[] = array(
                'to' => $this->person->email,
                'subject' => sprintf(AnTranslator::_('COM-PEOPLE-MAIL-SUBJECT-PASSWORD-RESET'), $settings->sitename),
                'template' => 'password_reset',
            );
            $this->mail($mails);
        }
    }
952069
protected function _actionRead(AnCommandContext $context)
    {
        if (! $this->_state->viewer->guest()) {
            $this->_state->setItem($this->_state->viewer);
            $this->getResponse()->setRedirect(route($this->_state->viewer->getURL()));
        }

        return $this->_state->viewer;
    }
339982
public function hasContext($context)
    {
        if ($this->contextConfiguration && array_key_exists($context, $this->contextConfiguration)) {
            return true;
        }

        return false;
    }