Issue Bug Resolved

#108597admin panel: fe user group simulation is wrong

David Menzel 01/06/26, 12:31 updated 09/30/26, 20:55

Description

Tested in TYPO3 12.4.39.

I wanted to test the FE user groups with the admin tool function and it seems there is a difference in comparison to real users.

The table in the screenshot shows she difference.
I created two FE user groups (Main/Sub) and the included the Sub group into the Main group.

+The following scenario has a difference+
Testuser/Simulate: Main Group
Page: Sub Group

+Result+
Page shows up for real user: YES
Page shows up for simulation: NO

So the real user is correct but not the simulation. The Main Group inherites the Sub Group but the Page is not visible, when added the “Sub Group” as permission group.

Reviews 2

Files 1

History 24

  1. Daniel Siepmann commented <span data-processor="relativetime" data-value="2026-06-11T05:36:58+00:00" > 06/11/26, 05:36 </span>

    Can you provide some more info? I’ve stumbled across a very similiar issue with TYPO3 13.4.30 and found out that TYPO3\CMS\Frontend\Middleware\PreviewSimulator and TYPO3\CMS\Adminpanel\Modules\PreviewModule don’t play together. The AdminPanel does not add the userGroups in the expected format, it uses generic array keys instead of group UIDs, leading to loosing some of the groups when reaching the PreviewSimulator.
    The following code change in TYPO3 13 worked for me:

    diff --git a/typo3/sysext/adminpanel/Classes/Modules/PreviewModule.php b/typo3/sysext/adminpanel/Classes/Modules/PreviewModule.php
    index e2483c3b38a..06deac85e3d 100644
    --- a/typo3/sysext/adminpanel/Classes/Modules/PreviewModule.php
    +++ b/typo3/sysext/adminpanel/Classes/Modules/PreviewModule.php
    @@ -196,7 +196,9 @@ class PreviewModule extends AbstractModule implements RequestEnricherInterface,
             if ($simulateUserGroup) {
                 $frontendUser = $request->getAttribute('frontend.user');
                 $frontendUser->user[$frontendUser->usergroup_column] = (string)$simulateUserGroup;
    -            $frontendUser->userGroups = $this->groupResolver->resolveGroupsForUser($frontendUser->user, 'fe_groups');
    +            foreach ($this->groupResolver->resolveGroupsForUser($frontendUser->user, 'fe_groups') as $userGroup) {
    +                $frontendUser->userGroups[$userGroup['uid']] = $userGroup;
    +            }
                 // let's fake having a user with that groups, too
                 // This can be removed once #90989 is fixed
                 $frontendUser->user['uid'] = PHP_INT_MAX;

    I’m not sure if one better changes resolveGroupsForUser() to return the expected array format. I didn’t investigate the consequences.

    Maybe you can test if the fix works for you as well.

    My suggestion:
    1. One should investigate whether the middleware or the API resolveGroupsForUser() should be fixed.
    2. Additionally, one should check the code of TYPO3\CMS\Frontend\Middleware\PreviewSimulator. It might be necessary to use the same API there, as otherwise parent pages might have other groups (parents, etc) leading to other issues if admin panel is not installed.

  2. Georg Ringer commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-09-30T20:55:09+00:00" > 09/30/26, 20:55 </span>

    Applied in changeset commit:ee644bd3ab07743c35020a9292dc76b7f951712e.