Actions
Bug #87223
closedTranslated root-page record of BE-User cannot be edited/saved (missing webmount)
Status:
Closed
Priority:
Must have
Assignee:
-
Category:
DataHandler aka TCEmain
Target version:
-
Start date:
2018-12-19
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
backend,page,tree,translation,permission,webmount,mount
Complexity:
Is Regression:
Sprint Focus:
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']; } }
Actions