From: SANDHYA.JS Date: Thu, 30 Jan 2025 12:46:56 +0000 (+0530) Subject: Fix Bug for roles deletion X-Git-Tag: v17.0.1^0 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=bd229362e32dcebd3f7e30605dbbb7c5c5901c40;p=osm%2FNG-UI.git Fix Bug for roles deletion - Roles null value acceptance bug in permissions Change-Id: I46547949385c908a0289874131fcc28290bb5743 Signed-off-by: SANDHYA.JS Signed-off-by: garciadeblas --- 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; }