Skip to content
Snippets Groups Projects
Commit 8ca13f87 authored by Achim Fritz's avatar Achim Fritz Committed by Benni Mack
Browse files

[BUGFIX] Set proper groups in AdminPanel

EXT:frontend's Preview simulation already sets the
userGroup values properly, which allows to simulate
a usergroup.

However, this change also needs to be set in EXT:adminpanel
in order to allow usergroups.

This change adds the same change (see #96381) as in
PreviewSimulator in EXT:adminpanel.

This is required as otherwise, the Frontend user would
re-set the userGroup in FrontendUserAuthentication->createUserAspect()

Resolves: #99718
Related: #96381
Releases: main, 11.5
Change-Id: I346f14e2c7bd655efe3883c3a1543bddff8364e8
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/77577


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
parent 089fd4c5
Branches
Tags
No related merge requests found
......@@ -201,6 +201,10 @@ class PreviewModule extends AbstractModule implements RequestEnricherInterface,
if ($simulateUserGroup) {
$frontendUser = $request->getAttribute('frontend.user');
$frontendUser->user[$frontendUser->usergroup_column] = $simulateUserGroup;
$frontendUser->userGroups[$simulateUserGroup] = [
'uid' => $simulateUserGroup,
'title' => '_PREVIEW_',
];
// let's fake having a user with that group, too
// This can be removed once #90989 is fixed
$frontendUser->user['uid'] = PHP_INT_MAX;
......
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