From e7b58ed2bdfe4bb56866e76b8fdd618946fa3c51 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 12 Jun 2014 17:53:56 +0200 Subject: Properly expose read only public shares as read only --- apps/files_sharing/ajax/shareinfo.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'apps/files_sharing/ajax') 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(''); -- cgit v1.2.3