From c23371a6e90e6587ddb484cffc081c8fd1a73039 Mon Sep 17 00:00:00 2001 From: "SANDHYA.JS" Date: Thu, 30 Jan 2025 18:16:56 +0530 Subject: [PATCH] Fix Bug for roles deletion - Roles null value acceptance bug in permissions Change-Id: I46547949385c908a0289874131fcc28290bb5743 Signed-off-by: SANDHYA.JS --- src/app/roles/roles-create-edit/RolesCreateEditComponent.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/roles/roles-create-edit/RolesCreateEditComponent.ts b/src/app/roles/roles-create-edit/RolesCreateEditComponent.ts index ae85112..a1d5d45 100644 --- a/src/app/roles/roles-create-edit/RolesCreateEditComponent.ts +++ b/src/app/roles/roles-create-edit/RolesCreateEditComponent.ts @@ -296,9 +296,9 @@ export class RolesCreateEditComponent implements OnInit { } else { this.roleForm.value.permissions = this.roleForm.value.permissions.replace(/'/g, '"'); const rolePermission: {} = JSON.parse(this.roleForm.value.permissions); - for (const key of Object.keys(rolePermission)) { + for (const key of Object.values(rolePermission)) { // eslint-disable-next-line security/detect-object-injection - if (typeof rolePermission[key] !== 'boolean') { + if (typeof key !== 'boolean' && key !== null) { this.notifierService.notify('error', this.translateService.instant('PAGE.ROLES.ROLEKEYERROR', { roleKey: key })); return false; } -- 2.25.1