-
Benni Mack authored
The backend user aspect must be set before BE_USER->fetchGroups is called and the TypoScript parser needs a proper ConditionMatcher object for the Symfony-based UserTSconfig conditions like [backend.user.isAdmin] to be working. Note to future self: The reason why the original change was reverted was that: - before workspace-related conditions did not work. - then workspaces worked, but conditions in userTSconfig bricked partially - the patch was reverted and left for dead for 1 year as it's a chicken-egg problem The main issue is that fetchGroup() is doing too much. - A valid user record exists, but the right workspace haven't been "set" which always returns workspace=0 for workspace-related conditions - So the workspace must be initialized earlier, and not at the end of the fetchGroups() call. - workspaceInit() - and some other code within fetchGroups() relies on finished TSconfig (that is the actual chicken-egg problem) So we'll just set the aspects before, but BEFORE setting the aspects, we'll evaluate the selected workspace of a user in a "plain" way. The reason why the backend context aspect now works (again) is because the context contains a "real" BE user object and fetches the data from the object, where as the workspace aspect just contains a static property. Resolves: #90075 Resolves: #86923 Related: #86229 Reverts: #86856 Releases: master, 9.5 Change-Id: I326d92a860a806ff13748cf13ef6b71b7a77089e Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62887 Reviewed-by: Susanne Moog <look@susi.dev> Reviewed-by: Henning Liebe <h.liebe@neusta.de> Reviewed-by: Sascha Rademacher <sascha.rademacher+typo3@gmail.com> Reviewed-by: Frank Nägler <frank.naegler@typo3.org> Reviewed-by: Felix P. <f.pachowsky@neusta.de> Reviewed-by: Benni Mack <benni@typo3.org> Tested-by: Susanne Moog <look@susi.dev> Tested-by: TYPO3com <noreply@typo3.com> Tested-by: Frank Nägler <frank.naegler@typo3.org> Tested-by: Benni Mack <benni@typo3.org>
7ffd8cb0