Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
(feat) one-click option to give all permissions for user (fixes #1637)
  • Loading branch information
extrafu committed Jun 20, 2016
1 parent 5ee5ccd commit 75dfebe
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions NEWS
Expand Up @@ -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)
------------------
Expand Down
5 changes: 5 additions & 0 deletions UI/Templates/UIxAclEditor.wox
Expand Up @@ -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()">
Expand Down
11 changes: 11 additions & 0 deletions UI/WebServerResources/js/Common/Acl.service.js
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions UI/WebServerResources/js/Common/AclController.js
Expand Up @@ -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,
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 75dfebe

Please sign in to comment.