(feat) one-click option to give all permissions for user (fixes #1637)

This commit is contained in:
Ludovic Marcotte
2016-06-20 09:10:50 -04:00
parent 5ee5ccd078
commit 75dfebe9ae
4 changed files with 22 additions and 0 deletions
@@ -130,6 +130,17 @@
});
};
/**
* @function $selectAllRights
* @memberof Acl.prototype
* @desc Select all rights of an user
*/
Acl.prototype.$selectAllRights = function(user) {
_.forEach(user.rights, function(value, right) {
user.rights[right] = 1;
});
};
/**
* @function $resetUsersRights
* @memberof Acl.prototype
@@ -21,6 +21,7 @@
vm.saveModal = saveModal;
vm.confirmChange = confirmChange;
vm.removeUser = removeUser;
vm.selectAllRights = selectAllRights;
vm.addUser = addUser;
vm.selectUser = selectUser;
vm.confirmation = { showing: false,
@@ -55,6 +56,10 @@
folder.$acl.$removeUser(user.uid);
}
function selectAllRights(user) {
folder.$acl.$selectAllRights(user);
}
function addUser(data) {
if (data) {
folder.$acl.$addUser(data).then(function(user) {