Commit 98a79c1b authored by catch's avatar catch
Browse files

Issue #3323380 by amateescu, smustgrave: Allow switching to any workspace in CLI requests

(cherry picked from commit 40c86d90)
parent 94be34d2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -240,8 +240,8 @@ public function switchToLive() {
   */
  protected function doSwitchWorkspace($workspace) {
    // If the current user doesn't have access to view the workspace, they
    // shouldn't be allowed to switch to it.
    if ($workspace && !$workspace->access('view')) {
    // shouldn't be allowed to switch to it, except in CLI processes.
    if ($workspace && PHP_SAPI !== 'cli' && !$workspace->access('view')) {
      $this->logger->error('Denied access to view workspace %workspace_label for user %uid', [
        '%workspace_label' => $workspace->label(),
        '%uid' => $this->currentUser->id(),