WIP: #5770 - Sync Groups Samba #1946

Draft
jsegarra wants to merge 38 commits from 5770_sambaGroups into dev
1 changed files with 0 additions and 17 deletions
Showing only changes of commit 92287cf7f5 - Show all commits

View File

@ -80,9 +80,6 @@ module.exports = class SambaHelper {
addMembers(role, user) { addMembers(role, user) {
return this.sambaTool('group', ['addmembers', role, user]); return this.sambaTool('group', ['addmembers', role, user]);
} }
editGroup(role, descriptrion = '') {
return this.sambaTool('group', ['edit', `${role}`, '--editor=\'vi\'']);
}
handleRoleMembers(users) { handleRoleMembers(users) {
if (users.length === 0) return []; if (users.length === 0) return [];
@ -160,24 +157,10 @@ module.exports = class SambaHelper {
if (this.rolesToInsert.length > 0) { if (this.rolesToInsert.length > 0) {
// PROCEDIMIENTO PARA INSERTAR ROLES // 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( const resultsRoleInsert = await Promise.all(
this.rolesToInsert.map(role => this.addRole(this.roles.get(role)))); this.rolesToInsert.map(role => this.addRole(this.roles.get(role))));
printResults(resultsRoleInsert); printResults(resultsRoleInsert);
} }
// const edit = await this.editGroup('$developer');
if (this.rolesToUpdate.length > 0) { if (this.rolesToUpdate.length > 0) {
for await (const role of this.rolesToUpdate) { for await (const role of this.rolesToUpdate) {