From 307071cfec088c2690c12a686578b49647ba5840 Mon Sep 17 00:00:00 2001
From: Robin Appelman <icewind@owncloud.com>
Date: Tue, 16 Sep 2014 20:54:11 +0200
Subject: [PATCH] Keep the share permissions from mountpoints

---
 apps/files_sharing/js/share.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js
index dd950e9b42..853e9f689f 100644
--- a/apps/files_sharing/js/share.js
+++ b/apps/files_sharing/js/share.js
@@ -21,7 +21,8 @@
 					var sharePermissions = fileData.permissions;
 					if (fileData.mountType && fileData.mountType === "external-root"){
 						// for external storages we cant use the permissions of the mountpoint
-						sharePermissions = OC.PERMISSION_ALL;
+						// instead we show all permissions and only use the share permissions from the mountpoint to handle resharing
+						sharePermissions = sharePermissions | (OC.PERMISSION_ALL & ~OC.PERMISSION_SHARE);
 					}
 					if (fileData.type === 'file') {
 						// files can't be shared with delete permissions
-- 
GitLab