diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2013-09-20 15:11:05 +0400 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2013-09-23 12:25:07 +0400 |
commit | a6466b1c7cee4f5023c8239f27963589a1088158 (patch) | |
tree | c17c20e6022eab70172af6fdaf62d0aa1a7bf70d /core | |
parent | 10944464c14b91e634ea83e9f02fe665099fd025 (diff) |
calculate correct permissions while toggle the password protection
Diffstat (limited to 'core')
-rw-r--r-- | core/js/share.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/core/js/share.js b/core/js/share.js index 6292877719f..fa435b81846 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -590,7 +590,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(); } |