mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-06-11 21:39:43 +00:00
fix(acl(js)): toggle rights from the ACL editor
This commit is contained in:
@@ -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";
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user