Issue Bug Closed

#107976EXT:workspaces preview.js crashes if editor is not an admin, because of weird access restriction

David Schneider 11/04/25, 11:18 updated 12/02/25, 12:04

Description

In /sysext/workspaces/Configuration/Backend/AjaxRoutes.php, workspace_dispatch is only accessible if the logged in user is an admin.
So editors, that want to send their changes to admins, so they can publish it, are not getting the buttons shown.
The /typo3/ajax/workspace/dispatch endpoint sends the buttons to show to the frontend javascript,
but since the needed permissions are wrong here, the script crashes due to the 403 status result from the fetch request.

I think the line 'inheritAccessFromModule' => 'workspaces_admin', should be removed from that file.

The line was introduced in TYPO3 12 and still exists in TYPO3 13 and 14.

return [
    // Set the workspace
    'workspace_switch' => [
        'path' => '/workspace/switch',
        'target' => \TYPO3\CMS\Workspaces\Controller\AjaxController::class . '::switchWorkspaceAction',
    ],
    'workspace_dispatch' => [
        'path' => '/workspace/dispatch',
        'target' => \TYPO3\CMS\Workspaces\Controller\AjaxDispatcher::class . '::dispatch',
        'inheritAccessFromModule' => 'workspaces_admin',
    ],
];

Reviews 3