summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/ajax
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-06-12 17:53:56 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2014-06-14 10:14:08 +0200
commite7b58ed2bdfe4bb56866e76b8fdd618946fa3c51 (patch)
treee2c42d3c7c5f08a4094aa61408d5dcf274d881f7 /apps/files_sharing/ajax
parent87e311b99628858ddb974cd35ae381a26b4bcdb5 (diff)
downloadnextcloud-server-e7b58ed2bdfe4bb56866e76b8fdd618946fa3c51.tar.gz
nextcloud-server-e7b58ed2bdfe4bb56866e76b8fdd618946fa3c51.zip
Properly expose read only public shares as read only
Diffstat (limited to 'apps/files_sharing/ajax')
-rw-r--r--apps/files_sharing/ajax/shareinfo.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/files_sharing/ajax/shareinfo.php b/apps/files_sharing/ajax/shareinfo.php
index 4aefdbe7b15..c5764867d56 100644
--- a/apps/files_sharing/ajax/shareinfo.php
+++ b/apps/files_sharing/ajax/shareinfo.php
@@ -33,6 +33,13 @@ $linkItem = $data['linkItem'];
// Load the files
$path = $data['realPath'];
+$isWritable = $linkItem['permissions'] & \OCP\PERMISSION_CREATE;
+if (!$isWritable) {
+ \OC\Files\Filesystem::addStorageWrapper('readonly', function ($mountPoint, $storage) {
+ return new \OCA\Files_Sharing\ReadOnlyWrapper(array('storage' => $storage));
+ });
+}
+
$rootInfo = \OC\Files\Filesystem::getFileInfo($path);
$rootView = new \OC\Files\View('');