Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/8.3' into 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
markusguenther committed Dec 13, 2024
2 parents 2a066db + b628c59 commit 640ea43
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
6 changes: 5 additions & 1 deletion Classes/Aspects/AugmentationAspect.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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;
}
}
23 changes: 19 additions & 4 deletions Classes/Controller/BackendServiceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

/**
Expand Down Expand Up @@ -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()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 640ea43

Please sign in to comment.