Issue Bug Closed

#94829Wrong workspace preview of published version if user has no access for live editing

Jessica Jagodzinski 08/12/21, 08:10 updated 12/06/22, 21:43

Description

If a user has no permissions to edit live, the user has no possibility to see the live version of an edited page when logged in. The user always sees the workspace version.

Steps to reproduce:
  • create a workspace and a user without “Edit Live” workspace_perms
  • switch to the user
  • edit an existing page
  • open preview of the page
  • use the slider to switch between published and staged version

Reviews 1

History 67

  1. Lidia Demin commented 02/17/22, 15:57

    Can confirm this problem on TYPO3 10.4.22. Might this be related to #96077?

  2. Oliver Pfaff commented 02/24/22, 15:49

    I can confirm this as well for version 11.5.7. Tested on clean and fresh ddev installation. When the Backend User has no access to the live workspace, the published view will be the preview from selected workspace and not from the live version as expected.

  3. Oliver Pfaff commented 02/25/22, 08:02

    I have done some quick debuggin in the fresh 11 version. And i found out where the problem is.

    Inside TYPO3\CMS\Workspaces\Middleware\WorkspacePreview.php we try to (Line 122)setTemporaryWorkspace to 0 alias Live/Production when ADMCMD_prev=LIVE is set as get parameter.

    But inside TYPO3\CMS\Core\Authentication\BackendUserAuthentication.php and the called Method setTemporaryWorkspace fails the check $this->checkWorkspace($workspaceId); because there this check about the access to live workspace fails:

    switch ((string)$wsRec['uid']) {
                        case '0':
                            $retVal = (($this->groupData['workspace_perms'] ?? 0) & 1)
                                ? array_merge($wsRec, ['_ACCESS' => 'online'])
                                : false;
                            break;

    so we need some kind of special check/perrmission when ADMCMD_prev=LIVE is set or when this is intended to be like it is(maybe there are some sicurity aspects), the preview view makes no sense and we should see only the workspace view.

    Maybe i will find the time to make my own contribution, anyway i hope with this info the issue can be resolved faster.

  4. Gerrit Code Review pushed patch set 1 for main to change 74171 status New Under Review 04/04/22, 20:41

  5. Nikita Hovratov changed Duplicates #93097 07/07/22, 21:12

  6. Eric Harrer commented and changed status Under Review Resolved 11/03/22, 09:06

    Applied in changeset commit:86724c7f54437c4bf7df029e6801e538a86f4178.

  7. Benni Mack changed status Resolved Closed 12/06/22, 21:43