Project

General

Profile

Actions

Bug #43429

closed

editPanel / editIcons: ts setting 'onlyCurrentPid = 1' ignored

Added by Frank Frewer almost 12 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2012-11-29
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

The sub setting 'onlyCurrentPid = 1' for editPanel / editIcons is ignored.

class.t3lib_frontendedit.php / function allowedToEdit:

        if ($editAccessInternals) {
            if ($table == 'pages') {
                    // 2 = permission to edit the page
                if ($GLOBALS['BE_USER']->isAdmin() || $GLOBALS['BE_USER']->doesUserHaveAccess($dataArray, 2)) {
                    $mayEdit = TRUE;
                }
            } else {
                    // 16 = permission to edit content on the page
                if ($GLOBALS['BE_USER']->isAdmin() || $GLOBALS['BE_USER']->doesUserHaveAccess(t3lib_BEfunc::getRecord('pages', $dataArray['pid']), 16)) {
                    $mayEdit = TRUE;
                }
            }

            if (!$conf['onlyCurrentPid'] || ($dataArray['pid'] == $GLOBALS['TSFE']->id)) {
                    // Permissions:
                $types = t3lib_div::trimExplode(',', t3lib_div::strtolower($conf['allow']), 1);
                $allow = array_flip($types);

                $perms = $GLOBALS['BE_USER']->calcPerms($GLOBALS['TSFE']->page);
                if ($table == 'pages') {
                    $allow = $this->getAllowedEditActions($table, $conf, $dataArray['pid'], $allow);

                        // Can only display editbox if there are options in the menu
                    if (count($allow)) {
                        $mayEdit = TRUE;
                    }
                } else {
                    $mayEdit = count($allow) && ($perms & 16);
                }
            }
        }

        return $mayEdit;


Maybe I don't understand the concept, but im my opinion
$GLOBALS['BE_USER']->doesUserHaveAccess(t3lib_BEfunc::getRecord('pages', $dataArray['pid']), 16) is a necessary but not sufficient condition to set $mayEdit to TRUE. My suggestion:
                if ($GLOBALS['BE_USER']->isAdmin() || ($GLOBALS['BE_USER']->doesUserHaveAccess(t3lib_BEfunc::getRecord('pages', $dataArray['pid']), 16) && !$conf['onlyCurrentPid'])) {
                    $mayEdit = TRUE;
                }

Actions #1

Updated by Mathias Schreiber almost 10 years ago

  • Target version set to 7.2 (Frontend)
  • Is Regression set to No
Actions #2

Updated by Benni Mack over 9 years ago

  • Target version changed from 7.2 (Frontend) to 7.4 (Backend)
Actions #3

Updated by Susanne Moog over 9 years ago

  • Target version changed from 7.4 (Backend) to 7.5
Actions #4

Updated by Benni Mack about 9 years ago

  • Target version changed from 7.5 to 7 LTS
Actions #5

Updated by Mathias Schreiber about 9 years ago

  • Target version deleted (7 LTS)
Actions #6

Updated by Gerrit Code Review over 4 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63616

Actions #7

Updated by Gerrit Code Review over 4 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63616

Actions #8

Updated by Gerrit Code Review over 4 years ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63744

Actions #9

Updated by Benni Mack over 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #10

Updated by Benni Mack over 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF