mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-21 14:43:31 +00:00
Improve ACL editor
This commit is contained in:
@@ -6,8 +6,8 @@
|
||||
/**
|
||||
* @ngInject
|
||||
*/
|
||||
AclController.$inject = ['$mdDialog', 'Dialog', 'usersWithACL', 'User', 'folder'];
|
||||
function AclController($mdDialog, Dialog, usersWithACL, User, folder) {
|
||||
AclController.$inject = ['$timeout', '$mdDialog', 'Dialog', 'usersWithACL', 'User', 'folder'];
|
||||
function AclController($timeout, $mdDialog, Dialog, usersWithACL, User, folder) {
|
||||
var vm = this;
|
||||
|
||||
vm.users = usersWithACL; // ACL users
|
||||
@@ -21,8 +21,8 @@
|
||||
vm.saveModal = saveModal;
|
||||
vm.confirmChange = confirmChange;
|
||||
vm.removeUser = removeUser;
|
||||
vm.selectAllRights = selectAllRights;
|
||||
vm.addUser = addUser;
|
||||
vm.selectAllRights = selectAllRights;
|
||||
vm.selectUser = selectUser;
|
||||
vm.confirmation = { showing: false,
|
||||
message: ''};
|
||||
@@ -53,11 +53,9 @@
|
||||
}
|
||||
|
||||
function removeUser(user) {
|
||||
folder.$acl.$removeUser(user.uid);
|
||||
}
|
||||
|
||||
function selectAllRights(user) {
|
||||
folder.$acl.$selectAllRights(user);
|
||||
$timeout(function() {
|
||||
folder.$acl.$removeUser(user.uid);
|
||||
}, 500); // wait for CSS transition to complete (see card.scss)
|
||||
}
|
||||
|
||||
function addUser(data) {
|
||||
@@ -68,13 +66,17 @@
|
||||
vm.selectedUid = null;
|
||||
if (user)
|
||||
selectUser(user);
|
||||
}, function(error) {
|
||||
Dialog.alert(l('Warning'), error);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function selectUser(user) {
|
||||
function selectAllRights(user) {
|
||||
folder.$acl.$selectAllRights(user);
|
||||
}
|
||||
|
||||
function selectUser(user, $event) {
|
||||
if ($event && $event.target.parentNode.classList.contains('md-secondary'))
|
||||
return false;
|
||||
if (vm.selectedUid == user.uid) {
|
||||
vm.selectedUid = null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user