diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-11-02 12:22:36 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2016-11-16 21:04:42 +0300 |
commit | e7b1196dd6ca011d8b60764f7c55a5896e96d106 (patch) | |
tree | 6c82560764e29a99d68a5b0ba68e57e5bfb309db /apps | |
parent | cc8750ca30ba5d13ca59cc8c3ce87122a451829a (diff) |
Hack to prevent warning for read-only wrapper in public links
Storage wrappers should normally always be registered inside a presetup
hook. However in the public link scenario this is not possible and
there is currently no good alternative with the current architecture.
Instead of logging a warning every time, this fix prevents the warning
to be shown but also adds a FIXME in the code for the future. This is
ok because this app is already using private/internal APIs at the
moment and should be reworked properly in the future.
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dav/appinfo/v1/publicwebdav.php | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/apps/dav/appinfo/v1/publicwebdav.php b/apps/dav/appinfo/v1/publicwebdav.php index 670eadd5ea9..95fb71032d5 100644 --- a/apps/dav/appinfo/v1/publicwebdav.php +++ b/apps/dav/appinfo/v1/publicwebdav.php @@ -73,14 +73,12 @@ $server = $serverFactory->createServer($baseuri, $requestUri, $authBackend, func $isReadable = $share->getPermissions() & \OCP\Constants::PERMISSION_READ; $fileId = $share->getNodeId(); - /* - if (!$isReadable) { - return false; - }*/ - + // FIXME: should not add storage wrappers outside of preSetup, need to find a better way + $previousLog = \OC\Files\Filesystem::logWarningWhenAddingStorageWrapper(false); \OC\Files\Filesystem::addStorageWrapper('sharePermissions', function ($mountPoint, $storage) use ($share) { return new \OC\Files\Storage\Wrapper\PermissionsMask(array('storage' => $storage, 'mask' => $share->getPermissions() | \OCP\Constants::PERMISSION_SHARE)); }); + \OC\Files\Filesystem::logWarningWhenAddingStorageWrapper($previousLog); OC_Util::setupFS($owner); $ownerView = \OC\Files\Filesystem::getView(); |