parent
edd606563f
commit
085fb83294
@ -39,10 +39,9 @@ export default class {
|
|||||||
push.apply(acls, entries)
|
push.apply(acls, entries)
|
||||||
})(acls.push)
|
})(acls.push)
|
||||||
|
|
||||||
const collection = this._acls
|
|
||||||
await Promise.all(mapToArray(
|
await Promise.all(mapToArray(
|
||||||
subjects,
|
subjects,
|
||||||
subject => collection.get({subject}).then(pushAcls)
|
subject => this.getAclsForSubject(subject).then(pushAcls)
|
||||||
))
|
))
|
||||||
|
|
||||||
return acls
|
return acls
|
||||||
@ -67,6 +66,10 @@ export default class {
|
|||||||
return this._acls.get()
|
return this._acls.get()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getAclsForSubject (subjectId) {
|
||||||
|
return this._acls.get({ subject: subjectId })
|
||||||
|
}
|
||||||
|
|
||||||
async getPermissionsForUser (userId) {
|
async getPermissionsForUser (userId) {
|
||||||
const [
|
const [
|
||||||
acls,
|
acls,
|
||||||
|
@ -100,6 +100,13 @@ export default class {
|
|||||||
})
|
})
|
||||||
::pCatch(noop) // Ignore any failures.
|
::pCatch(noop) // Ignore any failures.
|
||||||
|
|
||||||
|
// Remove ACLs for this user.
|
||||||
|
this._xo.getAclsForSubject(id).then(acls => {
|
||||||
|
forEach(acls, acl => {
|
||||||
|
this._xo.removeAcl(id, acl.object, acl.action)::pCatch(noop)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
// Remove the user from all its groups.
|
// Remove the user from all its groups.
|
||||||
forEach(user.groups, groupId => {
|
forEach(user.groups, groupId => {
|
||||||
this.getGroup(groupId)
|
this.getGroup(groupId)
|
||||||
|
Loading…
Reference in New Issue
Block a user