Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion Classes/Indexer/NodeIndexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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);
Expand Down