|
34 | 34 | use Neos\Neos\Domain\Service\WorkspacePublishingService;
|
35 | 35 | use Neos\Neos\Domain\Service\WorkspaceService;
|
36 | 36 | use Neos\Neos\FrontendRouting\SiteDetection\SiteDetectionResult;
|
| 37 | +use Neos\Neos\Security\Authorization\ContentRepositoryAuthorizationService; |
37 | 38 | use Neos\Neos\Service\UserService;
|
38 | 39 | use Neos\Neos\Ui\Application\ChangeTargetWorkspace;
|
39 | 40 | use Neos\Neos\Ui\Application\DiscardAllChanges;
|
@@ -155,6 +156,12 @@ class BackendServiceController extends ActionController
|
155 | 156 | */
|
156 | 157 | protected $reloadNodesQueryHandler;
|
157 | 158 |
|
| 159 | + /** |
| 160 | + * @Flow\Inject |
| 161 | + * @var ContentRepositoryAuthorizationService |
| 162 | + */ |
| 163 | + protected $contentRepositoryAuthorizationService; |
| 164 | + |
158 | 165 | /**
|
159 | 166 | * Set the controller context on the feedback collection after the controller
|
160 | 167 | * has been initialized
|
@@ -588,12 +595,15 @@ public function getAdditionalNodeMetadataAction(array $nodes): void
|
588 | 595 | return $this->getCurrentDimensionPresetIdentifiersForNode($node);
|
589 | 596 | }, $node->getOtherNodeVariants())));*/
|
590 | 597 | if (!is_null($node)) {
|
| 598 | + $authenticatedAccount = $this->securityContext->getAccount(); |
| 599 | + $nodePrivileges = $authenticatedAccount === null |
| 600 | + ? $this->contentRepositoryAuthorizationService->getNodePermissionsForAnonymousUser($node) |
| 601 | + : $this->contentRepositoryAuthorizationService->getNodePermissionsForAccount($node, $authenticatedAccount); |
591 | 602 | $result[$nodeAddress->toJson()] = [
|
592 |
| - // todo reimplement nodePolicyService |
593 | 603 | 'policy' => [
|
594 | 604 | 'disallowedNodeTypes' => [],
|
595 |
| - 'canRemove' => true, |
596 |
| - 'canEdit' => true, |
| 605 | + 'canRemove' => $nodePrivileges->edit, |
| 606 | + 'canEdit' => $nodePrivileges->edit, |
597 | 607 | 'disallowedProperties' => []
|
598 | 608 | ]
|
599 | 609 | //'dimensions' => $this->getCurrentDimensionPresetIdentifiersForNode($node),
|
|
0 commit comments