Commit 3607634b authored by Oliver Bartsch's avatar Oliver Bartsch Committed by Anja Leichsenring
Browse files

[BUGFIX] Use correct page id for permission calculation of inline controls

For the inline record header controls the InlineRecordContainer calculates
the permissions for the page, the record is on. Previously the calculation
was based on the records pid. This does not work for new records as the
pid is a negative integer in this case - uid of the record the `new` button
was pressed on - and therefore led to no header controls were displayed
till the record was saved.

The calculation now uses the correct uid from `parentPageRow`.

Resolves: #84867
Releases: master, 10.4
Change-Id: I3d60f41ed51ff2f013d37c6aa9c118974d06acad
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/65999

Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
parent a4503ed3
......@@ -445,7 +445,7 @@ class InlineRecordContainer extends AbstractContainer
$isSysFileReferenceTable = $foreignTable === 'sys_file_reference';
$enableManualSorting = $tcaTableCtrl['sortby'] || $inlineConfig['MM'] || !$data['isOnSymmetricSide']
&& $inlineConfig['foreign_sortby'] || $data['isOnSymmetricSide'] && $inlineConfig['symmetric_sortby'];
$calcPerms = new Permission($backendUser->calcPerms(BackendUtility::readPageAccess($rec['pid'], $backendUser->getPagePermsClause(Permission::PAGE_SHOW))));
$calcPerms = new Permission($backendUser->calcPerms(BackendUtility::readPageAccess((int)($data['parentPageRow']['uid'] ?? 0), $backendUser->getPagePermsClause(Permission::PAGE_SHOW))));
// If the listed table is 'pages' we have to request the permission settings for each page:
$localCalcPerms = new Permission(Permission::NOTHING);
if ($isPagesTable) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment