[BUGFIX] Restricted elements should show edit options
authorGeorg Ringer <georg.ringer@gmail.com>
Mon, 29 Oct 2012 22:17:34 +0000 (23:17 +0100)
committerHelmut Hummel <helmut.hummel@typo3.org>
Mon, 29 Oct 2012 23:03:47 +0000 (00:03 +0100)
If a content element is not allowed to be edited, e.g.
because the ctype is not allowed to the current backend user,
the edit options should not be shown. Also the content
element should not be linked - the form is not displayed
anyway but an ugly error is shown.

Change-Id: I94beefdf6fc6a910201ab8fba4dbda0c5d174359
Fixes: #42501
Releases: 6.0
Reviewed-on: http://review.typo3.org/16023
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
typo3/sysext/backend/Classes/View/PageLayoutView.php

index 6a2ef48..ef42fc0 100644 (file)
@@ -1098,7 +1098,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                // Load full table description:
                \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('tt_content');
                // If show info is set...;
-               if ($this->tt_contentConfig['showInfo']) {
+               if ($this->tt_contentConfig['showInfo'] && $GLOBALS['BE_USER']->recordEditAccessInternals('tt_content', $row)) {
                        // Render control panel for the element:
                        if ($this->tt_contentConfig['showCommands'] && $this->doEdit) {
                                // Edit content element:
@@ -1417,7 +1417,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
        public function linkEditContent($str, $row) {
                $addButton = '';
                $onClick = '';
-               if ($this->doEdit) {
+               if ($this->doEdit && $GLOBALS['BE_USER']->recordEditAccessInternals('tt_content', $row)) {
                        // Setting onclick action for content link:
                        $onClick = \TYPO3\CMS\Backend\Utility\BackendUtility::editOnClick('&edit[tt_content][' . $row['uid'] . ']=edit', $this->backPath);
                }
@@ -1592,11 +1592,13 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
        public function getIcon($table, $row) {
                // Initialization
                $alttext = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordIconAltText($row, $table);
-               $iconImg = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord($table, $row, array('title' => $alttext));
+               $icon = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord($table, $row, array('title' => $alttext));
                $this->counter++;
                // The icon with link
-               $theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($iconImg, $table, $row['uid']);
-               return $theIcon;
+               if ($GLOBALS['BE_USER']->recordEditAccessInternals($table, $row)) {
+                       $icon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($icon, $table, $row['uid']);
+               }
+               return $icon;
        }
 
        /**