]> 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>
Wed, 22 Apr 2015 14:19:52 +0000 (16:19 +0200)
apps/files_sharing/publicwebdav.php

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