diff --git a/Classes/Aspects/AugmentationAspect.php b/Classes/Aspects/AugmentationAspect.php index 1138d150de..c29f45d82d 100644 --- a/Classes/Aspects/AugmentationAspect.php +++ b/Classes/Aspects/AugmentationAspect.php @@ -145,6 +145,10 @@ public function editableElementAugmentation(JoinPointInterface $joinPoint) return $content; } + if ($this->nodeAuthorizationService->isGrantedToEditNode($node) === false) { + return $content; + } + $content = $joinPoint->getAdviceChain()->proceed($joinPoint); $attributes = [ @@ -166,6 +170,6 @@ protected function needsMetadata(NodeInterface $node, $renderCurrentDocumentMeta /** @var $contentContext ContentContext */ $contentContext = $node->getContext(); - return ($contentContext->isInBackend() === true && ($renderCurrentDocumentMetadata === true || $this->nodeAuthorizationService->isGrantedToEditNode($node) === true)); + return $contentContext->isInBackend() === true || $renderCurrentDocumentMetadata === true; } } diff --git a/Classes/Controller/BackendServiceController.php b/Classes/Controller/BackendServiceController.php index 54dfa87b20..cae2de946d 100644 --- a/Classes/Controller/BackendServiceController.php +++ b/Classes/Controller/BackendServiceController.php @@ -189,11 +189,18 @@ protected function updateWorkspaceInfo(string $documentNodeContextPath): void { $updateWorkspaceInfo = new UpdateWorkspaceInfo(); $documentNode = $this->nodeService->getNodeFromContextPath($documentNodeContextPath, null, null, true); - $updateWorkspaceInfo->setWorkspace( - $documentNode->getContext()->getWorkspace() - ); + if ($documentNode === null) { + $error = new Error(); + $error->setMessage(sprintf('Could not find node for document node context path "%s"', $documentNodeContextPath)); + + $this->feedbackCollection->add($error); + } else { + $updateWorkspaceInfo->setWorkspace( + $documentNode->getContext()->getWorkspace() + ); - $this->feedbackCollection->add($updateWorkspaceInfo); + $this->feedbackCollection->add($updateWorkspaceInfo); + } } /** @@ -237,6 +244,14 @@ public function publishAction(array $nodeContextPaths, string $targetWorkspaceNa foreach ($nodeContextPaths as $contextPath) { $node = $this->nodeService->getNodeFromContextPath($contextPath, null, null, true); + if ($node === null) { + $error = new Info(); + $error->setMessage(sprintf('Could not find node for context path "%s"', $contextPath)); + + $this->feedbackCollection->add($error); + + continue; + } $this->publishingService->publishNode($node, $targetWorkspace); if ($node->getNodeType()->isAggregate()) { diff --git a/packages/neos-ui-guest-frame/src/InlineUI/NodeToolbar/Buttons/PasteClipBoardNode/index.js b/packages/neos-ui-guest-frame/src/InlineUI/NodeToolbar/Buttons/PasteClipBoardNode/index.js index 79f255a60a..fecf882255 100644 --- a/packages/neos-ui-guest-frame/src/InlineUI/NodeToolbar/Buttons/PasteClipBoardNode/index.js +++ b/packages/neos-ui-guest-frame/src/InlineUI/NodeToolbar/Buttons/PasteClipBoardNode/index.js @@ -15,7 +15,7 @@ import {selectors, actions} from '@neos-project/neos-ui-redux-store'; return (state, {contextPath}) => { const clipboardNodesContextPaths = selectors.CR.Nodes.clipboardNodesContextPathsSelector(state); - const canBePasted = (clipboardNodesContextPaths.every(clipboardNodeContextPath => { + const canBePasted = Boolean(clipboardNodesContextPaths.length && clipboardNodesContextPaths.every(clipboardNodeContextPath => { return canBePastedSelector(state, { subject: clipboardNodeContextPath, reference: contextPath