Commit 70e23e55 authored by Hamza HRAMCHI's avatar Hamza HRAMCHI
Browse files

FIX #17436 TIME 0:10 send authorized groups when updating privilege

parent 95102482
......@@ -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');
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment