LDAP sync hotfix
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
3acc943d85
commit
b2a3adc96f
|
@ -146,17 +146,22 @@ module.exports = Self => {
|
|||
|
||||
if (!info.hasAccount) return;
|
||||
|
||||
reqs = [];
|
||||
for (let role of info.user.roles()) {
|
||||
let roleName = role.inherits().name;
|
||||
|
||||
let dn = `cn=${roleName},${this.groupDn}`;
|
||||
let change = new ldap.Change({
|
||||
operation: 'add',
|
||||
modification: {memberUid: userName}
|
||||
});
|
||||
let roleName = role.inherits().name;
|
||||
let dn = `cn=${roleName},${this.groupDn}`;
|
||||
reqs.push(client.modify(dn, change));
|
||||
|
||||
try {
|
||||
await client.modify(dn, change);
|
||||
} catch (err) {
|
||||
if (err.name !== 'NoSuchObjectError')
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
await Promise.all(reqs);
|
||||
},
|
||||
|
||||
async getUsers(usersToSync) {
|
||||
|
|
Loading…
Reference in New Issue