diff --git a/src/frontend/app/administration/group/group.component.ts b/src/frontend/app/administration/group/group.component.ts index 6aa8be59abcf11f4bf29dc2f23e5df2e53b2c0db..5526003ebb9acf7355e35c36b464cd7f86c17f5c 100644 --- a/src/frontend/app/administration/group/group.component.ts +++ b/src/frontend/app/administration/group/group.component.ts @@ -142,6 +142,8 @@ export class GroupComponent implements OnInit { const { data } = await modal.onWillDismiss(); if (data !== undefined) { this.groups = data; + const manageUers: any = this.group.privileges.find((item: any) => item.id === 'manage_users'); + this.updatePrivilege(manageUers); } } @@ -257,7 +259,6 @@ export class GroupComponent implements OnInit { } modifyGroup() { - this.group['authorized'] = this.groups; this.loading = true; this.http.put('../rest/groups/' + this.group.id, this.group) .pipe( @@ -274,7 +275,6 @@ export class GroupComponent implements OnInit { } createGroup() { - this.group['authorized'] = this.groups; this.loading = true; this.http.post('../rest/groups', this.group) .pipe( @@ -364,7 +364,13 @@ export class GroupComponent implements OnInit { } updatePrivilege(privilege: any) { - this.http.put('../rest/groups/' + this.group.id + '/privilege/' + privilege.id, { checked: privilege.checked }) + const objTosend: any = { + checked: privilege.checked + }; + if (privilege.id === 'manage_users') { + objTosend['authorized'] = this.groups; + } + this.http.put('../rest/groups/' + this.group.id + '/privilege/' + privilege.id, objTosend) .pipe( tap(() => { this.notificationService.success('lang.privilegeUpdated');