Revert "[BUGFIX] Set BackendUserAspect earlier to make it usable in TSConfig" 45/58845/3
authorOliver Hader <oliver@typo3.org>
Mon, 5 Nov 2018 18:02:36 +0000 (19:02 +0100)
committerAndreas Wolf <andreas.wolf@typo3.org>
Wed, 14 Nov 2018 02:00:21 +0000 (03:00 +0100)
This reverts commit 52c391df3d4070d7bb192c724597141111e70b21.

When a backend user has set a workspace, this needs
to happen AFTER the user has been initialized (and
the proper workspace has been set), otherwise all
workspace queries are nailed down to "wsid=-99".

Resolves: #86856
Related: #86229
Releases: master
Change-Id: Iee804f99639e1957421818f7ed2bff134b269244
Reviewed-on: https://review.typo3.org/58845
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Andreas Wolf <andreas.wolf@typo3.org>
Tested-by: Andreas Wolf <andreas.wolf@typo3.org>
typo3/sysext/backend/Classes/Middleware/BackendUserAuthenticator.php

index 14cb108..d868567 100644 (file)
@@ -60,11 +60,11 @@ class BackendUserAuthenticator implements MiddlewareInterface
         $pathToRoute = $request->getAttribute('routePath', '/login');
 
         Bootstrap::initializeBackendUser();
-        // Register the backend user as aspect
-        $this->setBackendUserAspect(GeneralUtility::makeInstance(Context::class), $GLOBALS['BE_USER']);
         // @todo: once this logic is in this method, the redirect URL should be handled as response here
         Bootstrap::initializeBackendAuthentication($this->isLoggedInBackendUserRequired($pathToRoute));
         Bootstrap::initializeLanguageObject();
+        // Register the backend user as aspect
+        $this->setBackendUserAspect(GeneralUtility::makeInstance(Context::class), $GLOBALS['BE_USER']);
 
         return $handler->handle($request);
     }