From bc66bdc0725f51c3ff119e2fc852fccbc6c692aa Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Tue, 14 Apr 2020 14:42:28 +0200 Subject: Add a wrapper to fall back to the share owner on public shares Else it might happen that we setup a storage that has no real owner and activities do boom etc (looking at you groupfolders and external storages!). Signed-off-by: Roeland Jago Douma --- apps/dav/appinfo/v1/publicwebdav.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'apps/dav/appinfo/v1/publicwebdav.php') diff --git a/apps/dav/appinfo/v1/publicwebdav.php b/apps/dav/appinfo/v1/publicwebdav.php index c50bc134131..556dd35de58 100644 --- a/apps/dav/appinfo/v1/publicwebdav.php +++ b/apps/dav/appinfo/v1/publicwebdav.php @@ -82,7 +82,9 @@ $server = $serverFactory->createServer($baseuri, $requestUri, $authPlugin, funct \OC\Files\Filesystem::addStorageWrapper('sharePermissions', function ($mountPoint, $storage) use ($share) { return new \OC\Files\Storage\Wrapper\PermissionsMask(['storage' => $storage, 'mask' => $share->getPermissions() | \OCP\Constants::PERMISSION_SHARE]); }); - + \OC\Files\Filesystem::addStorageWrapper('shareOwner', function ($mountPoint, $storage) use ($share) { + return new \OCA\DAV\Storage\PublicOwnerWrapper(['storage' => $storage, 'owner' => $share->getShareOwner()]); + }); \OC\Files\Filesystem::logWarningWhenAddingStorageWrapper($previousLog); OC_Util::tearDownFS(); -- cgit v1.2.3