Issue Bug Closed

#87223Translated root-page record of BE-User cannot be edited/saved (missing webmount)

Philipp Seiler 12/19/18, 17:33 updated 12/23/19, 22:48

Description

  • Use Backend as a non-admin BE-User.
  • This backend user has a root page as the DB-Mount (webmount).
  • This root page has some subpages.
  • The root page is translated into any different language.
  • Translate any subpage.
  • Edit/save any subpage.
  • In \TYPO3\CMS\Core\Authentication\BackendUserAuthentication the method isInWebMount checks if the page being edited is in any allowed webmount.
  • At first, all webmounts from the user permissions are retrieved. Note that ONLY the root language version UIDs of selected webmounts are found!
  • Within that method, BackendUtility::BEgetRootLine returns the rootline up to the root page.
  • If a page of the rootline is within the users lists of webmounts, the record can be edited.

This is OK.

Translated root page cannot be edited/saved

  • Root page is also translated.
  • Edit root page with the BE-User: Attempt to modify record ‘Home’ (pages:123) without permission. Or non-existing page.
  • Again the method isInWebMount checks if the page can be edited.
  • Again the allowed webmounts of the user are retrieved. Again ONLY the root language version UID of selected webmounts are found!
  • Rootline only returns one element, as we are already on the root page. The returned page is the translated root page!
  • That translated root page however has a different UID than defined in the webmounts! The webmount UID is that of the root language version.
  • Therefore no valid webmount is found.

When checking for permissions, translated pages need to be taken into account!

Workaround

Adjust \TYPO3\CMS\Core\Authentication\BackendUserAuthentication::isInWebMount() so that translated webroots are also selected.

$wM = $this->returnWebmounts();
$rL = BackendUtility::BEgetRootLine($id, ' AND ' . $readPerms);

// Fix bug with UID of translated webmount not taken into account
$wM = $this->addTranslatedWebmounts($wM);

foreach ($rL as $v) {
    if ($v['uid'] && in_array($v['uid'], $wM)) {
        return $v['uid'];
    }
}

Reviews 3