]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix public share webdav permissions
authorRobin Appelman <icewind@owncloud.com>
Fri, 13 Jun 2014 13:13:53 +0000 (15:13 +0200)
committerBjoern Schiessle <schiessle@owncloud.com>
Sat, 14 Jun 2014 08:22:38 +0000 (10:22 +0200)
apps/files_sharing/ajax/shareinfo.php
apps/files_sharing/publicwebdav.php

index e3735ddadd5c35130968ed9a30608c0af3571a7b..be26c3579785f320d2a7c906f7a4318138f8cc1f 100644 (file)
@@ -33,7 +33,7 @@ $linkItem = $data['linkItem'];
 // Load the files
 $path = $data['realPath'];
 
-$isWritable = $linkItem['permissions'] & \OCP\PERMISSION_CREATE;
+$isWritable = $linkItem['permissions'] & (\OCP\PERMISSION_UPDATE | \OCP\PERMISSION_CREATE);
 if (!$isWritable) {
        \OC\Files\Filesystem::addStorageWrapper('readonly', function ($mountPoint, $storage) {
                return new \OCA\Files_Sharing\ReadOnlyWrapper(array('storage' => $storage));
index b41d3a238ac1f82de86d6cd69aee1a791739f2b5..4c0eb1537cd63089116359eb986f5ba03b4870db 100644 (file)
@@ -41,7 +41,7 @@ $server->addPlugin(new OC_Connector_Sabre_ExceptionLoggerPlugin('webdav'));
 $server->subscribeEvent('beforeMethod', function () use ($server, $objectTree, $authBackend) {
        $share = $authBackend->getShare();
        $owner = $share['uid_owner'];
-       $isWritable = $share['permissions'];
+       $isWritable = $share['permissions'] & (\OCP\PERMISSION_UPDATE | \OCP\PERMISSION_CREATE);
        $fileId = $share['file_source'];
 
        if (!$isWritable) {