public function evaluate()
{
$content = $this->getValue();
/** @var $node NodeInterface */
$node = $this->tsValue('node');
if (!$node instanceof NodeInterface) {
return $content;
}
/** @var $contentContext ContentContext */
$contentContext = $node->getContext();
if ($contentContext->getWorkspaceName() === 'live') {
return $content;
}
if (!$this->privilegeManager->isPrivilegeTargetGranted('Neos.Neos:Backend.GeneralAccess')) {
return $content;
}
if ($node->isRemoved()) {
$content = '';
}
if ($this->tsValue('renderCurrentDocumentMetadata')) {
return $this->contentElementWrappingService->wrapCurrentDocumentMetadata($node, $content, $this->getContentElementTypoScriptPath());
}
return $this->contentElementWrappingService->wrapContentObject($node, $content, $this->getContentElementTypoScriptPath());
}