[Pkg-owncloud-commits] [owncloud] 66/111: Check which permissions are possible to re-share a file

David Prévot taffit at moszumanska.debian.org
Wed Nov 20 21:38:43 UTC 2013


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 7f3d717037e03a96a3cb5ed9c654502db3817228
Author: Bjoern Schiessle <schiessle at owncloud.com>
Date:   Mon Nov 18 11:58:42 2013 +0100

    Check which permissions are possible to re-share a file
---
 core/js/share.js |   17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/core/js/share.js b/core/js/share.js
index 411f0d2..e2911ae 100644
--- a/core/js/share.js
+++ b/core/js/share.js
@@ -190,6 +190,7 @@ OC.Share={
 			}
 			html += '<br />';
 		}
+
 		if (possiblePermissions & OC.PERMISSION_SHARE) {
 			// Determine the Allow Public Upload status.
 			// Used later on to determine if the
@@ -292,7 +293,21 @@ OC.Share={
 				var shareWith = selected.item.value.shareWith;
 				$(this).val(shareWith);
 				// Default permissions are Edit (CRUD) and Share
-				var permissions = OC.PERMISSION_ALL;
+				// Check if these permissions are possible
+				var permissions = OC.PERMISSION_READ;
+				if (possiblePermissions & OC.PERMISSION_UPDATE) {
+					permissions = permissions | OC.PERMISSION_UPDATE;
+				}
+				if (possiblePermissions & OC.PERMISSION_CREATE) {
+					permissions = permissions | OC.PERMISSION_CREATE;
+				}
+				if (possiblePermissions & OC.PERMISSION_DELETE) {
+					permissions = permissions | OC.PERMISSION_DELETE;
+				}
+				if (possiblePermissions & OC.PERMISSION_SHARE) {
+					permissions = permissions | OC.PERMISSION_SHARE;
+				}
+
 				OC.Share.share(itemType, itemSource, shareType, shareWith, permissions, itemSourceName, function() {
 					OC.Share.addShareWith(shareType, shareWith, selected.item.label, permissions, possiblePermissions);
 					$('#shareWith').val('');

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list