Commit 469cf385 authored by Hamza HRAMCHI's avatar Hamza HRAMCHI
Browse files

FIX #17436 TIME 0:10 update url + getPrivilegeParameters function

parent daf048f1
......@@ -158,32 +158,30 @@ export class GroupComponent implements OnInit {
}
getPrivilegeParameters() {
const privilege: any = this.group.privileges.find((item: any) => item.id === 'manage_users');
return new Promise((resolve) => {
this.http.get('../rest/groups/' + this.group.id + '/privilege/' + privilege.id).pipe(
this.http.get('../rest/groups/' + this.group.id).pipe(
tap((data: any) => {
this.allGroups.forEach((element: any, index: number) => {
if (this.groups.find((item: any) => item.id === element.id) === undefined) {
let checked: boolean;
if (data.parameters.authorized !== undefined) {
if (data.parameters.authorized.indexOf(element.id) > -1) {
checked = true;
const manageUsers: any = data.group.privileges.find((item: any) => item.id === 'manage_users');
if (!this.functions.empty(manageUsers)) {
this.allGroups.forEach((element: any, index: number) => {
if (this.groups.find((item: any) => item.id === element.id) === undefined) {
let checked: boolean;
if (!this.functions.empty(manageUsers.parameters.authorized)) {
checked = manageUsers.parameters.authorized.indexOf(element.id) > -1;
} else {
checked = false;
checked = true;
}
} else {
checked = true;
this.groups.push(
{
id: element.id,
label: element.label,
checked: checked
}
);
}
this.groups.push(
{
id: element.id,
label: element.label,
checked: checked
}
);
}
});
this.groups = [...new Set(this.groups)];
});
this.groups = [...new Set(this.groups)];
}
resolve(true);
}),
catchError((err: any) => {
......
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