fix(group.delete): remove associated ACLs

Fixes vatesfr/xo-web#899
This commit is contained in:
Julien Fontanet 2016-09-16 15:47:09 +02:00
parent 085fb83294
commit 1b64b0468a

View File

@ -254,6 +254,13 @@ export default class {
await this._groups.remove(id)
// Remove ACLs for this group.
this._xo.getAclsForSubject(id).then(acls => {
forEach(acls, acl => {
this._xo.removeAcl(id, acl.object, acl.action)::pCatch(noop)
})
})
// Remove the group from all its users.
forEach(group.users, userId => {
this.getUser(userId)