|
36 | 36 | use Neos\ContentRepository\Search\Indexer\AbstractNodeIndexer; |
37 | 37 | use Neos\ContentRepository\Search\Indexer\BulkNodeIndexerInterface; |
38 | 38 | use Neos\Flow\Annotations as Flow; |
| 39 | +use Neos\Flow\Security\Context as SecurityContext; |
39 | 40 | use Neos\Utility\Exception\FilesException; |
40 | 41 | use Neos\Flow\Log\Utility\LogEnvironment; |
41 | 42 | use Psr\Log\LoggerInterface; |
@@ -145,6 +146,12 @@ class NodeIndexer extends AbstractNodeIndexer implements BulkNodeIndexerInterfac |
145 | 146 | */ |
146 | 147 | protected $errorStorage; |
147 | 148 |
|
| 149 | + /** |
| 150 | + * @Flow\Inject |
| 151 | + * @var SecurityContext |
| 152 | + */ |
| 153 | + protected $securityContext; |
| 154 | + |
148 | 155 | /** |
149 | 156 | * The current Elasticsearch bulk request, in the format required by https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html |
150 | 157 | */ |
@@ -270,7 +277,12 @@ public function indexNode(NodeInterface $node, $targetWorkspace = null): void |
270 | 277 | }; |
271 | 278 |
|
272 | 279 | $handleNode = function (NodeInterface $node, Context $context) use ($targetWorkspace, $indexer) { |
273 | | - $nodeFromContext = $context->getNodeByIdentifier($node->getIdentifier()); |
| 280 | + $nodeFromContext = null; |
| 281 | + $this->securityContext->withoutAuthorizationChecks( |
| 282 | + function () use ($context, $node, &$nodeFromContext) { |
| 283 | + $nodeFromContext = $context->getNodeByIdentifier($node->getIdentifier()); |
| 284 | + } |
| 285 | + ); |
274 | 286 | if ($nodeFromContext instanceof NodeInterface) { |
275 | 287 | $this->searchClient->withDimensions(static function () use ($indexer, $nodeFromContext, $targetWorkspace) { |
276 | 288 | $indexer($nodeFromContext, $targetWorkspace); |
|
0 commit comments