only use one kind of hack for the storage wrappers of the sharing code

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
Morris Jobke 2016-11-14 16:13:05 +01:00
parent db8b66c546
commit fcb6386b04
No known key found for this signature in database
GPG Key ID: 9CE5ED29E7FCD38A
1 changed files with 3 additions and 0 deletions

View File

@ -63,9 +63,12 @@ $path = $data['realPath'];
$isWritable = $share->getPermissions() & (\OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_CREATE);
if (!$isWritable) {
// 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('readonly', function ($mountPoint, $storage) {
return new \OC\Files\Storage\Wrapper\PermissionsMask(array('storage' => $storage, 'mask' => \OCP\Constants::PERMISSION_READ + \OCP\Constants::PERMISSION_SHARE));
});
\OC\Files\Filesystem::logWarningWhenAddingStorageWrapper($previousLog);
}
$rootInfo = \OC\Files\Filesystem::getFileInfo($path);