summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-09-20 13:11:05 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2013-09-20 13:11:05 +0200
commit12b4e7920148e1cf586fa96fafe7fee33a12523b (patch)
treea41d4c142ac4403214f1b7f8faec44ec9117391e /core
parent944e9b8c69c4b78f7afbc6153d35cd50da060b09 (diff)
downloadnextcloud-server-12b4e7920148e1cf586fa96fafe7fee33a12523b.tar.gz
nextcloud-server-12b4e7920148e1cf586fa96fafe7fee33a12523b.zip
calculate correct permissions while toggle the password protection
Diffstat (limited to 'core')
-rw-r--r--core/js/share.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/core/js/share.js b/core/js/share.js
index 5d34faf8a5d..f0fc4136e61 100644
--- a/core/js/share.js
+++ b/core/js/share.js
@@ -603,7 +603,17 @@ $(document).ready(function() {
if (!$('#showPassword').is(':checked') ) {
var itemType = $('#dropdown').data('item-type');
var itemSource = $('#dropdown').data('item-source');
- OC.Share.share(itemType, itemSource, OC.Share.SHARE_TYPE_LINK, '', OC.PERMISSION_READ);
+ var allowPublicUpload = $('#sharingDialogAllowPublicUpload').is(':checked');
+
+ // Calculate permissions
+ if (allowPublicUpload) {
+ permissions = OC.PERMISSION_UPDATE + OC.PERMISSION_CREATE + OC.PERMISSION_READ;
+ } else {
+ permissions = OC.PERMISSION_READ;
+ }
+
+
+ OC.Share.share(itemType, itemSource, OC.Share.SHARE_TYPE_LINK, '', permissions);
} else {
$('#linkPassText').focus();
}