From 12591f39116d3c7a3e059a81cd1aeaced97ad092 Mon Sep 17 00:00:00 2001 From: nathangray Date: Fri, 4 Jun 2021 13:58:59 -0600 Subject: [PATCH] Api: Fix Asyncservice did not have proper filesystem access as the job user --- api/src/Asyncservice.php | 1 + api/src/Vfs/UserContextTrait.php | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/api/src/Asyncservice.php b/api/src/Asyncservice.php index b90725e3c5..d169f0c786 100644 --- a/api/src/Asyncservice.php +++ b/api/src/Asyncservice.php @@ -450,6 +450,7 @@ class Asyncservice } // set VFS user for vfs access rights Vfs::$user = $job['account_id']; + Vfs\StreamWrapper::init_static(); Vfs::clearstatcache(); } else diff --git a/api/src/Vfs/UserContextTrait.php b/api/src/Vfs/UserContextTrait.php index 9c6cf34fa3..77eb87d7ba 100644 --- a/api/src/Vfs/UserContextTrait.php +++ b/api/src/Vfs/UserContextTrait.php @@ -210,6 +210,10 @@ trait UserContextTrait $this->context = stream_context_create($options); } } + else + { + $this->context = stream_context_create(); + } break; } }