diff --git a/Classes/FrontendEnvironment/Tsfe.php b/Classes/FrontendEnvironment/Tsfe.php index 6a1f128b40..f1c6e6ff12 100644 --- a/Classes/FrontendEnvironment/Tsfe.php +++ b/Classes/FrontendEnvironment/Tsfe.php @@ -144,6 +144,20 @@ protected function initializeTsfe(int $pageId, int $language = 0, ?int $rootPage $userGroups = explode(',', $pageRecord['fe_group']); } else { $userGroups = [0, -1]; + + // Check rootline for feGroups from page with extendToSubpages set + $rootline = BackendUtility::BEgetRootLine($pageId); + // remove the current page from the rootline + array_shift($rootline); + foreach ($rootline as $page) { + // Skip root node, invalid pages and pages which do not define extendToSubpages + if ((int)($page['uid'] ?? 0) <= 0 || !($page['extendToSubpages'] ?? false)) { + continue; + } + $userGroups = explode(',', $page['fe_group']); + // Stop as soon as a page in the rootline has extendToSubpages set + break; + } } $feUser->user = ['uid' => 0, 'username' => '', 'usergroup' => implode(',', $userGroups) ]; $feUser->fetchGroupData($serverRequest);