|
|
|
|
@ -127,20 +127,19 @@ export class UserPermissionsComponent {
|
|
|
|
|
|
|
|
|
|
onUserChange() {
|
|
|
|
|
this.showPermissions = true;
|
|
|
|
|
const params = new HttpParams().set(FormConstants.POR_ORGACODE, this.credentialService.getPorOrgacode())
|
|
|
|
|
.append(FormConstants.USER_ID, this.permission.get('userCode')?.value);
|
|
|
|
|
// this.httpService.requestGET(URIKey.USER_GET_PERMISSIONS, params).subscribe((response: any) => {
|
|
|
|
|
// if (!(response instanceof HttpErrorResponse)) {
|
|
|
|
|
// if (response.permission) {
|
|
|
|
|
// this.updatePermissions(JSON.parse(response.permission), this.permissions);
|
|
|
|
|
// }
|
|
|
|
|
// else {
|
|
|
|
|
// this.defaultPermissions().subscribe((data: PermissionNode[]) => {
|
|
|
|
|
// this.permissions = data;
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
const params = new HttpParams().set('userId', this.permission.get('userCode')?.value);
|
|
|
|
|
this.httpService.requestGET(URIKey.USER_GET_PERMISSIONS, params).subscribe((response: any) => {
|
|
|
|
|
if (!(response instanceof HttpErrorResponse)) {
|
|
|
|
|
if (response.permission) {
|
|
|
|
|
this.updatePermissions(JSON.parse(response.permission), this.permissions);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
this.defaultPermissions().subscribe((data: PermissionNode[]) => {
|
|
|
|
|
this.permissions = data;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
savePermissions() {
|
|
|
|
|
|