integrated get permission for a specific user API

aconnect-UX/1716
atif118-mfsys 1 month ago
parent 7788668973
commit 23d65b82d2

@ -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() {

@ -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"
}
]
}

Loading…
Cancel
Save