User - resolve posix groups for all member groups
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Garrett Mills 2021-03-10 20:15:04 -06:00
parent 48f5b3f71a
commit 0ee36dc429
Signed by: garrettmills
GPG Key ID: D2BF5FBA8298F246

View File

@ -194,6 +194,11 @@ class User extends AuthUser {
const shell = this.login_shell || this.configs.get('ldap:server.schema.default_shell')
const domain = this.configs.get('ldap:server.schema.base_dc').split(',').map(x => x.replace('dc=', '')).join('.')
const group_ids = []
for ( const group of await this.groups() ) {
group_ids.push(await group.get_gid_number())
}
const ldap_data = {
uid: this.uid.toLowerCase(),
uuid: this.uuid,
@ -208,7 +213,7 @@ class User extends AuthUser {
objectGuid: this.uuid,
objectguid: this.uuid,
uidNumber: uid_number,
gidNumber: uid_number,
gidNumber: group_ids.map(x => String(x)),
loginShell: shell,
homeDirectory: `/home/${this.uid}@${domain}`
}