shesha-io / shesha-framework

An open-source Low-Code development framework for .NET developers. Create .NET based business applications with 80% less code.
https://shesha.io
Apache License 2.0
285 stars 45 forks source link

Error thrown when deleting child permission after parent deletion #1436

Closed hlayisanimazuze closed 2 weeks ago

hlayisanimazuze commented 2 weeks ago

When a parent permission is deleted before its child permission, attempting to delete the child permission results in an error being thrown on the UI

Steps to reproduce the behavior:

  1. Go to 'https://function-adminportal-test.shesha.dev/dynamic/Shesha/permission-configurator'
  2. Click on 'Create root'
  3. Enter the required information and save
  4. Afterwards, create a child permission related to the permission created
  5. After child permission created, click on the root parent permission and click on 'delete'
  6. Actual Results: The permission should be deleted and the child permission won't show
  7. Refresh the page
  8. Actual Results: The child permission shows
  9. Click the child permission and click on delete
  10. Actual Results: Cannot read properties of null(reading is DbPermission) and when you refresh it will be removed

Expected behavior The child permission should be deleted successfully without throwing an error

image