src/bundle/eZ/RichText/Renderer.php
protected function checkContentPermissions(Content $content)
    {
        // Check both 'content/read' and 'content/view_embed'.
        if (
            !$this->authorizationChecker->isGranted(
                new AuthorizationAttribute('content', 'read', ['valueObject' => $content])
            )
            && !$this->authorizationChecker->isGranted(
                new AuthorizationAttribute('content', 'view_embed', ['valueObject' => $content])
            )
        ) {
            throw new AccessDeniedException();
        }

        // Check that Content is published, since sudo allows loading unpublished content.
        if (
            !$content->getVersionInfo()->isPublished()
            && !$this->authorizationChecker->isGranted(
                new AuthorizationAttribute('content', 'versionread', ['valueObject' => $content])
            )
        ) {
            throw new AccessDeniedException();
        }
    }
protected function checkContentPermissions(Content $content)
    {
        // Check both 'content/read' and 'content/view_embed'.
        if (
            !$this->authorizationChecker->isGranted(
                new AuthorizationAttribute('content', 'read', ['valueObject' => $content])
            )
            && !$this->authorizationChecker->isGranted(
                new AuthorizationAttribute('content', 'view_embed', ['valueObject' => $content])
            )
        ) {
            throw new AccessDeniedException();
        }

        // Check that Content is published, since sudo allows loading unpublished content.
        if (
            !$content->getVersionInfo()->isPublished()
            && !$this->authorizationChecker->isGranted(
                new AuthorizationAttribute('content', 'versionread', ['valueObject' => $content])
            )
        ) {
            throw new AccessDeniedException();
        }
    }
protected function checkContentPermissions ( Content $ content ) { // Check both 'content/read' and 'content/view_embed'. if ( ! $ this -> authorizationChecker -> isGranted ( new AuthorizationAttribute ( 'content' , 'read' , [ 'valueObject' => $ content ] ) ) && ! $ this -> authorizationChecker -> isGranted ( new AuthorizationAttribute ( 'content' , 'view_embed' , [ 'valueObject' => $ content ] ) ) ) { throw new AccessDeniedException ( ) ; } // Check that Content is published, since sudo allows loading unpublished content. if ( ! $ content -> getVersionInfo ( ) -> isPublished ( ) && ! $ this -> authorizationChecker -> isGranted ( new AuthorizationAttribute ( 'content' , 'versionread' , [ 'valueObject' => $ content ] ) ) ) { throw new AccessDeniedException ( ) ; } }
Check embed permissions for the given Content.

@throws \Symfony\Component\Security\Core\Exception\AccessDeniedException

@param \eZ\Publish\API\Repository\Values\Content\Content $content
Check embed permissions for the given Content .