From 23d65b82d25a350aa89b4c648c06a42e629bac7d Mon Sep 17 00:00:00 2001 From: atif118-mfsys Date: Thu, 1 Jan 2026 14:32:37 +0500 Subject: [PATCH] integrated get permission for a specific user API --- .../user-permissions.component.ts | 27 +++++++++---------- src/assets/data/app.uri.json | 5 ++++ 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/app/user-permissions/user-permissions.component.ts b/src/app/user-permissions/user-permissions.component.ts index 0041386..1bd2ed8 100644 --- a/src/app/user-permissions/user-permissions.component.ts +++ b/src/app/user-permissions/user-permissions.component.ts @@ -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() { diff --git a/src/assets/data/app.uri.json b/src/assets/data/app.uri.json index 9be8317..65e93ab 100644 --- a/src/assets/data/app.uri.json +++ b/src/assets/data/app.uri.json @@ -41,6 +41,11 @@ "Id" : "ENTITY_DELETE_USER", "URI": "/user/deleteUser", "UUID": "DELETE_USER" + }, + { + "Id" : "ENTITY_USER_GET_PERMISSIONS", + "URI": "/user/getPermissions", + "UUID": "USER_GET_PERMISSIONS" } ] }