]> source.dussan.org Git - nextcloud-server.git/commitdiff
resolve reshares in public webdav
authorRobin Appelman <icewind@owncloud.com>
Wed, 22 Apr 2015 14:19:52 +0000 (16:19 +0200)
committerRobin Appelman <icewind@owncloud.com>
Fri, 24 Apr 2015 12:19:52 +0000 (14:19 +0200)
apps/files_sharing/publicwebdav.php

index 03e43967a4042873901aa855be8eb7db327d5179..3e000534bbbf6dbea1dc6466fae0f7a16fa3c410 100644 (file)
@@ -40,9 +40,10 @@ $server->addPlugin(new OC_Connector_Sabre_ExceptionLoggerPlugin('webdav'));
 // wait with registering these until auth is handled and the filesystem is setup
 $server->subscribeEvent('beforeMethod', function () use ($server, $objectTree, $authBackend) {
        $share = $authBackend->getShare();
-       $owner = $share['uid_owner'];
-       $isWritable = $share['permissions'] & (\OCP\PERMISSION_UPDATE | \OCP\PERMISSION_CREATE);
-       $fileId = $share['file_source'];
+       $rootShare = \OCP\Share::resolveReShare($share);
+       $owner = $rootShare['uid_owner'];
+       $isWritable = $rootShare['permissions'] & (\OCP\PERMISSION_UPDATE | \OCP\PERMISSION_CREATE);
+       $fileId = $rootShare['file_source'];
 
        if (!$isWritable) {
                \OC\Files\Filesystem::addStorageWrapper('readonly', function ($mountPoint, $storage) {