diff --git a/UI/Templates/AdministrationUI/UIxAdministrationAclEditor.wox b/UI/Templates/AdministrationUI/UIxAdministrationAclEditor.wox index 24e7b1f28..eecb6ed96 100644 --- a/UI/Templates/AdministrationUI/UIxAdministrationAclEditor.wox +++ b/UI/Templates/AdministrationUI/UIxAdministrationAclEditor.wox @@ -69,7 +69,7 @@ - @@ -84,7 +84,7 @@
{{user.c_email}}
select_all diff --git a/UI/Templates/UIxAclEditor.wox b/UI/Templates/UIxAclEditor.wox index 8db082e7a..d49828ae4 100644 --- a/UI/Templates/UIxAclEditor.wox +++ b/UI/Templates/UIxAclEditor.wox @@ -66,7 +66,7 @@
select_all diff --git a/UI/WebServerResources/js/Common/Acl.service.js b/UI/WebServerResources/js/Common/Acl.service.js index 2c87f7561..aa0068edd 100644 --- a/UI/WebServerResources/js/Common/Acl.service.js +++ b/UI/WebServerResources/js/Common/Acl.service.js @@ -136,12 +136,15 @@ * @memberof Acl.prototype * @desc Select all rights of an user */ - Acl.prototype.$selectAllRights = function(user) { - _.forEach(user.rights, function(value, right) { - if (angular.isNumber(user.rights[right])) - user.rights[right] = 1; - else - user.rights[right] = "Modifier"; + Acl.prototype.$toggleAllRights = function(user) { + var unselected = !angular.isUndefined(_.find(_.values(user.rights), function (right) { + return (right !== 1) && (right !== "Modifier"); + })); + _.forEach(user.rights, function(value, right) { + if (angular.isNumber(user.rights[right])) + user.rights[right] = unselected ? 1 : 0; + else + user.rights[right] = unselected ? "Modifier" : "None"; }); }; diff --git a/UI/WebServerResources/js/Common/AclController.js b/UI/WebServerResources/js/Common/AclController.js index 2de1a656f..e7b8bd837 100644 --- a/UI/WebServerResources/js/Common/AclController.js +++ b/UI/WebServerResources/js/Common/AclController.js @@ -24,7 +24,7 @@ vm.confirmChange = confirmChange; vm.removeUser = removeUser; vm.addUser = addUser; - vm.selectAllRights = selectAllRights; + vm.toggleAllRights = toggleAllRights; vm.selectUser = selectUser; vm.hasNoRight = hasNoRight; vm.showRights = showRights; @@ -87,8 +87,8 @@ } } - function selectAllRights(user) { - folder.$acl.$selectAllRights(user); + function toggleAllRights(user) { + folder.$acl.$toggleAllRights(user); } function selectUser(user, $event) {