eZ\Publish\Core\MVC\Symfony\FieldType\RichText\Renderer::checkLocation PHP Метод

checkLocation() защищенный Метод

Checks embed permissions for the given Location $id and returns the Location.
protected checkLocation ( integer | string $id ) : eZ\Publish\API\Repository\Values\Content\Location
$id integer | string
Результат eZ\Publish\API\Repository\Values\Content\Location
    protected function checkLocation($id)
    {
        /** @var \eZ\Publish\API\Repository\Values\Content\Location $location */
        $location = $this->repository->sudo(function (Repository $repository) use($id) {
            return $repository->getLocationService()->loadLocation($id);
        });
        // Check both 'content/read' and 'content/view_embed'.
        if (!$this->authorizationChecker->isGranted(new AuthorizationAttribute('content', 'read', array('valueObject' => $location->contentInfo, 'targets' => $location))) && !$this->authorizationChecker->isGranted(new AuthorizationAttribute('content', 'view_embed', array('valueObject' => $location->contentInfo, 'targets' => $location)))) {
            throw new AccessDeniedException();
        }
        return $location;
    }