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

pull/217/head
Ludovic Marcotte 2016-06-20 09:10:50 -04:00
parent 5ee5ccd078
commit 75dfebe9ae
4 changed files with 22 additions and 0 deletions

1
NEWS
View File

@ -29,6 +29,7 @@ Bug fixes
- [web] if cn isn't found for shared mailboxes, use email address (#3733)
- [web] fixed handling of attendees when updating an event
- [web] show tooltips over long calendar/ab names (#232)
- [web] one-click option to give all permissions for user (#1637)
3.1.2 (2016-06-06)
------------------

View File

@ -64,6 +64,11 @@
<div class="sg-md-subhead"><div>{{user.cn}}</div></div>
<div class="sg-md-body"><div>{{user.c_email}}</div></div>
</div>
<md-button class="md-icon-button md-secondary" type="button"
ng-click="acl.selectAllRights(user)"
ng-hide="user.uid != acl.selectedUid || user.$isSpecial()">
<md-icon>select_all</md-icon>
</md-button>
<md-button class="md-icon-button md-secondary" type="button"
ng-click="acl.removeUser(user)"
ng-hide="user.uid != acl.selectedUid || user.$isSpecial()">

View File

@ -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

View File

@ -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) {