summaryrefslogtreecommitdiffstats
path: root/settings/js
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2017-12-01 11:35:01 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2018-02-27 12:29:25 +0100
commit1615312bf1044dcbd98c7e4739467314ada618cf (patch)
tree9788f5cb7fe746078953cafadf78e3b2e845d52b /settings/js
parent7d0102bf7302a483209e0d1c926260713f0e56c6 (diff)
downloadnextcloud-server-1615312bf1044dcbd98c7e4739467314ada618cf.tar.gz
nextcloud-server-1615312bf1044dcbd98c7e4739467314ada618cf.zip
add share permissions to settings page
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'settings/js')
-rw-r--r--settings/js/admin.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/settings/js/admin.js b/settings/js/admin.js
index 177f6d3f7f4..f637cb64592 100644
--- a/settings/js/admin.js
+++ b/settings/js/admin.js
@@ -121,6 +121,28 @@ $(document).ready(function(){
}
});
+ $('#shareApiDefaultPermissionsSection input').change(function(ev) {
+ var $el = $('#shareApiDefaultPermissions');
+ var $target = $(ev.target);
+
+ var value = $el.val();
+ if ($target.is(':checked')) {
+ value = value | $target.val();
+ } else {
+ value = value & ~$target.val();
+ }
+
+ // always set read permission
+ value |= OC.PERMISSION_READ;
+
+ // this will trigger the field's change event and will save it
+ $el.val(value).change();
+
+ ev.preventDefault();
+
+ return false;
+ });
+
var savePublicShareDisclaimerText = _.debounce(function(value) {
var options = {
success: function() {