diff --git a/Classes/Indexer/NodeIndexer.php b/Classes/Indexer/NodeIndexer.php index 8d7572f2..08e28444 100644 --- a/Classes/Indexer/NodeIndexer.php +++ b/Classes/Indexer/NodeIndexer.php @@ -36,6 +36,7 @@ use Neos\ContentRepository\Search\Indexer\AbstractNodeIndexer; use Neos\ContentRepository\Search\Indexer\BulkNodeIndexerInterface; use Neos\Flow\Annotations as Flow; +use Neos\Flow\Security\Context as SecurityContext; use Neos\Utility\Exception\FilesException; use Neos\Flow\Log\Utility\LogEnvironment; use Psr\Log\LoggerInterface; @@ -145,6 +146,12 @@ class NodeIndexer extends AbstractNodeIndexer implements BulkNodeIndexerInterfac */ protected $errorStorage; + /** + * @Flow\Inject + * @var SecurityContext + */ + protected $securityContext; + /** * The current Elasticsearch bulk request, in the format required by https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html */ @@ -270,7 +277,12 @@ public function indexNode(NodeInterface $node, $targetWorkspace = null): void }; $handleNode = function (NodeInterface $node, Context $context) use ($targetWorkspace, $indexer) { - $nodeFromContext = $context->getNodeByIdentifier($node->getIdentifier()); + $nodeFromContext = null; + $this->securityContext->withoutAuthorizationChecks( + function () use ($context, $node, &$nodeFromContext) { + $nodeFromContext = $context->getNodeByIdentifier($node->getIdentifier()); + } + ); if ($nodeFromContext instanceof NodeInterface) { $this->searchClient->withDimensions(static function () use ($indexer, $nodeFromContext, $targetWorkspace) { $indexer($nodeFromContext, $targetWorkspace);