diff --git a/modules/account/back/models/samba-helper.js b/modules/account/back/models/samba-helper.js index 14388fc28..b21dd6a34 100644 --- a/modules/account/back/models/samba-helper.js +++ b/modules/account/back/models/samba-helper.js @@ -119,6 +119,10 @@ module.exports = class SambaHelper { } async syncFromDB() { + // await this.adClient.del( + // `cn=developer,${this.fullGroupsDn}`, + + // ); // OBTENER ROLES await this.getRoles(); // const rolesKeys = Array.from(this.roles.keys()).sort(); @@ -156,6 +160,19 @@ module.exports = class SambaHelper { if (this.rolesToInsert.length > 0) { // PROCEDIMIENTO PARA INSERTAR ROLES + // for (const $role of this.rolesToInsert) { + // const {name, description} = this.roles.get($role); + + // const changed = await this.adClient.add( + // `cn=${$role},${this.fullGroupsDn}`, + // { + // cn: $role, + // description: description, + // objectClass: ['top', 'posixGroup', 'sambaGroupMapping'] + // } + // ); + // console.log(changed); + // } const resultsRoleInsert = await Promise.all( this.rolesToInsert.map(role => this.addRole(this.roles.get(role)))); printResults(resultsRoleInsert); @@ -168,10 +185,13 @@ module.exports = class SambaHelper { const groupDescriptionAttribute = { description: this.roles.get(role).$description, }; - const changed = await this.adClient.modify(`cn=${role},${this.fullGroupsDn}`, new ldap.Change({ - operation: 'replace', - modification: groupDescriptionAttribute, - })); + const changed = await this.adClient.modify( + `cn=${role},${this.fullGroupsDn}`, + new ldap.Change({ + operation: 'replace', + modification: groupDescriptionAttribute, + }) + ); console.log(changed); // await this.deleteRole(role); // await this.addRole(this.roles.get(role));