From: Robin Appelman Date: Fri, 13 Jun 2014 13:13:53 +0000 (+0200) Subject: Fix public share webdav permissions X-Git-Tag: v7.0.0alpha2~16^2~16 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4bc8a2550d5558fba21f9b450f07d754dbb14d4b;p=nextcloud-server.git Fix public share webdav permissions --- diff --git a/apps/files_sharing/ajax/shareinfo.php b/apps/files_sharing/ajax/shareinfo.php index e3735ddadd5..be26c357978 100644 --- a/apps/files_sharing/ajax/shareinfo.php +++ b/apps/files_sharing/ajax/shareinfo.php @@ -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)); diff --git a/apps/files_sharing/publicwebdav.php b/apps/files_sharing/publicwebdav.php index b41d3a238ac..4c0eb1537cd 100644 --- a/apps/files_sharing/publicwebdav.php +++ b/apps/files_sharing/publicwebdav.php @@ -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) {