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();
        }
    }