|
41 | 41 | use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry; |
42 | 42 | use Neos\Flow\Annotations as Flow; |
43 | 43 | use Neos\Flow\Log\Utility\LogEnvironment; |
| 44 | +use Neos\Flow\Security\Context; |
44 | 45 | use Neos\Utility\Exception\FilesException; |
45 | 46 | use Psr\Log\LoggerInterface; |
46 | 47 |
|
@@ -153,6 +154,9 @@ class NodeIndexer extends AbstractNodeIndexer implements BulkNodeIndexerInterfac |
153 | 154 | #[Flow\Inject] |
154 | 155 | protected ContentRepositoryRegistry $contentRepositoryRegistry; |
155 | 156 |
|
| 157 | + #[Flow\Inject] |
| 158 | + protected Context $securityContext; |
| 159 | + |
156 | 160 | /** @var array<ContentRepository> */ |
157 | 161 | private array $contentRepositoryRuntimeCache = []; |
158 | 162 |
|
@@ -270,10 +274,13 @@ public function indexNode(Node $node, ?WorkspaceName $targetWorkspaceName = null |
270 | 274 | } |
271 | 275 | }; |
272 | 276 |
|
273 | | - $handleNode = function (Node $node, WorkspaceName $workspaceName, DimensionSpacePoint $dimensionSpacePoint) use ($contentRepository, $targetWorkspaceName, $indexer) { |
274 | | - $subgraph = $contentRepository->getContentGraph($workspaceName)->getSubgraph($dimensionSpacePoint, VisibilityConstraints::withoutRestrictions()); |
275 | | - $nodeFromContext = $subgraph->findNodeById($node->aggregateId); |
276 | | - |
| 277 | + $handleNode = function (Node $node, WorkspaceName $workspaceName, DimensionSpacePoint $dimensionSpacePoint) use ($contentRepository, $targetWorkspaceName, $indexer, &$nodeFromContext) { |
| 278 | + $nodeFromContext = $this->securityContext->withoutAuthorizationChecks( |
| 279 | + fn() => $contentRepository |
| 280 | + ->getContentGraph($workspaceName) |
| 281 | + ->getSubgraph($dimensionSpacePoint, VisibilityConstraints::withoutRestrictions()) |
| 282 | + ->findNodeById($node->aggregateId) |
| 283 | + ); |
277 | 284 | if ($nodeFromContext instanceof Node) { |
278 | 285 | $this->searchClient->withDimensions(static function () use ($indexer, $nodeFromContext, $targetWorkspaceName) { |
279 | 286 | $indexer($nodeFromContext, $targetWorkspaceName); |
|
0 commit comments