test(samba): refs #5770 update group when change description
gitea/salix/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Javier Segarra 2024-05-13 19:13:35 +02:00
parent a2e4a65c3a
commit 52e4d3aed8
1 changed files with 13 additions and 2 deletions

View File

@ -1,4 +1,5 @@
const {differences, printResults} = require('../util/helpers'); const {differences, printResults} = require('../util/helpers');
const ldap = require('../util/ldapjs-extra');
const ROLE_PREFIX = '$'; const ROLE_PREFIX = '$';
const app = require('vn-loopback/server/server'); const app = require('vn-loopback/server/server');
@ -163,8 +164,18 @@ module.exports = class SambaHelper {
if (this.rolesToUpdate.length > 0) { if (this.rolesToUpdate.length > 0) {
for await (const role of this.rolesToUpdate) { for await (const role of this.rolesToUpdate) {
await this.deleteRole(role); if (this.roles.get(role).$description != sambaCurrentGroups.get(role).description) {
await this.addRole(this.roles.get(role)); 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,
}));
console.log(changed);
// await this.deleteRole(role);
// await this.addRole(this.roles.get(role));
}
} }
} }
} }