From 04998df1ea45c36739a06808de701e267d36ac9b Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 20 Jun 2017 10:35:22 +0200 Subject: [PATCH] Also allow group admins to toogle the storage location Signed-off-by: Joas Schilling --- settings/js/users/users.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/settings/js/users/users.js b/settings/js/users/users.js index 99d5a558b6..a1482549fb 100644 --- a/settings/js/users/users.js +++ b/settings/js/users/users.js @@ -965,17 +965,15 @@ $(document).ready(function () { // Option to display/hide the "Storage location" column $('#CheckboxStorageLocation').click(function() { if ($('#CheckboxStorageLocation').is(':checked')) { - OCP.AppConfig.setValue('core', 'umgmt_show_storage_location', 'true', { - success: function () { - $("#userlist .storageLocation").show(); - } - }); + $("#userlist .storageLocation").show(); + if (OC.isUserAdmin()) { + OCP.AppConfig.setValue('core', 'umgmt_show_storage_location', 'true'); + } } else { - OCP.AppConfig.setValue('core', 'umgmt_show_storage_location', 'false', { - success: function () { - $("#userlist .storageLocation").hide(); - } - }); + $("#userlist .storageLocation").hide(); + if (OC.isUserAdmin()) { + OCP.AppConfig.setValue('core', 'umgmt_show_storage_location', 'false'); + } } });