[BUGFIX] Allow users without delete permissions to drag pages in page tree 35/55535/2
authorTymoteusz Motylewski <t.motylewski@gmail.com>
Thu, 7 Dec 2017 13:46:48 +0000 (14:46 +0100)
committerSusanne Moog <susanne.moog@typo3.org>
Tue, 6 Feb 2018 20:35:59 +0000 (21:35 +0100)
BE users without delete rights can now drag-drop pages in the page tree.
The drag - delete area is not shown.

Resolves: #25135
Releases: 8.7, 7.6
Change-Id: Icc82675a783f19ae72b6d00ac2809ad76b93dd67
Reviewed-on: https://review.typo3.org/55535
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
typo3/sysext/backend/Classes/Tree/Pagetree/Commands.php
typo3/sysext/backend/Classes/Tree/Pagetree/PagetreeNode.php
typo3/sysext/backend/Resources/Public/JavaScript/extjs/components/pagetree/javascript/tree.js

index 2e67ef1..6c05d3d 100644 (file)
@@ -372,7 +372,6 @@ class Commands
         }
         if (
             !$subNode->canBeEdited()
-            || !$subNode->canBeRemoved()
             || VersionState::cast($record['t3ver_state'])->equals(VersionState::DELETE_PLACEHOLDER)
         ) {
             $subNode->setDraggable(false);
index 82b39f5..c70371b 100644 (file)
@@ -424,6 +424,7 @@ class PagetreeNode extends \TYPO3\CMS\Backend\Tree\ExtDirectNode
         $arrayRepresentation['realId'] = $this->getId();
         $arrayRepresentation['nodeData']['id'] = $this->getId();
         $arrayRepresentation['readableRootline'] = $this->getReadableRootline();
+        $arrayRepresentation['canBeRemoved'] = $this->canBeRemoved();
         $arrayRepresentation['nodeData']['readableRootline'] = $this->getReadableRootline();
         $arrayRepresentation['nodeData']['mountPoint'] = $this->getMountPoint();
         $arrayRepresentation['nodeData']['workspaceId'] = $this->getWorkspaceId();
index abcbd0d..3ec1e5d 100644 (file)
@@ -462,7 +462,7 @@ TYPO3.Components.PageTree.Tree = Ext.extend(Ext.tree.TreePanel, {
         */
        initDd: function(treePanel, node) {
                var nodeHasChildNodes = (node.hasChildNodes() || node.isExpandable());
-               if (this.deletionDropZoneId &&
+               if (this.deletionDropZoneId && node.attributes.canBeRemoved &&
                        (!nodeHasChildNodes ||
                        (nodeHasChildNodes && TYPO3.Components.PageTree.Configuration.canDeleteRecursivly)
                )) {