WIP: #5770 - Sync Groups Samba #1946
|
@ -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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue