[BUGFIX] Show new content button for editors in page module again 57/48057/7
authorGianluigi Martino <gmartino27@gmail.com>
Tue, 10 May 2016 08:48:26 +0000 (10:48 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Tue, 10 May 2016 12:16:57 +0000 (14:16 +0200)
Editors (group) doesn't see the new content button without page edit
permission in page module. with this bugfix editors can insert new content
again.

Change-Id: Ie8957b3386dfca8a91b7718bedba16af7559b373
Resolves: #76036
Releases: master, 7.6
Reviewed-on: https://review.typo3.org/48057
Reviewed-by: Adrian Mot <adrian.mot@gmail.com>
Tested-by: Adrian Mot <adrian.mot@gmail.com>
Reviewed-by: Gianluigi Martino <gmartino27@gmail.com>
Tested-by: Gianluigi Martino <gmartino27@gmail.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/backend/Classes/Controller/PageLayoutController.php
typo3/sysext/backend/Classes/View/PageLayoutView.php

index 9b658f0..711b2d0 100755 (executable)
@@ -1371,7 +1371,7 @@ class PageLayoutController
      *
      * @return bool
      */
-    protected function contentIsNotLockedForEditors()
+    public function contentIsNotLockedForEditors()
     {
         return $this->getBackendUser()->isAdmin() || ($this->CALC_PERMS & Permission::CONTENT_EDIT) === Permission::CONTENT_EDIT && !$this->pageinfo['editlock'];
     }
index 28f6a33..e8b85b9 100644 (file)
@@ -524,8 +524,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                 $content[$key] .= '">';
                 // Add new content at the top most position
                 $link = '';
-                if ($this->getPageLayoutController()->pageIsNotLockedForEditors()
-                    && $this->getBackendUser()->doesUserHaveAccess($this->pageinfo, Permission::CONTENT_EDIT)
+                if ($this->getPageLayoutController()->contentIsNotLockedForEditors()
                     && (!$this->checkIfTranslationsExistInLanguage($contentRecordsPerColumn, $lP))
                 ) {
                     if ($this->option_newWizard) {
@@ -638,8 +637,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                                 '-' . StringUtility::getUniqueId() . '">';
                             // Add icon "new content element below"
                             if (!$disableMoveAndNewButtons
-                                && $this->getPageLayoutController()->pageIsNotLockedForEditors()
-                                && $this->getBackendUser()->doesUserHaveAccess($this->pageinfo, Permission::CONTENT_EDIT)
+                                && $this->getPageLayoutController()->contentIsNotLockedForEditors()
                                 && (!$this->checkIfTranslationsExistInLanguage($contentRecordsPerColumn, $lP))
                             ) {
                                 // New content element: