Base solution for your next web application
Open Closed

Deleting an Organization Unit leaves Roles assigned to Users #8837


User avatar
0
atideveloper created

I had an Organization Unit with a Role and a User associated with it. I deleted the OU and now when I edit the User it shows that it still has the Role and that it is from an OU, but it does not show any OU anywhere. The problem is there is no way to remove this Role from the user now so it will be there forever. I have not tested if the User still gets the permission for that Role, but my guess is it will.

Is this expected behavior? Seems strange to me if it is since OU's and Roles are built in feature and not something I should have to mess with unless I want to enhance it somehow. I would expect that if I delete an OU then the Roles and Permissions that it was granting are no longer granted and do not show up in the UI.

My current OU view:

What it shows for the User that was part of that OU:


7 Answer(s)
  • User Avatar
    0
    atideveloper created

    I have found another post related to this and it looks like some code changes were made back in January to fix this (https://github.com/aspnetzero/aspnet-zero-core/issues/2892). Those changes are in my source and the objects seem to be getting soft deleted when I look at the DB. They still show up in the UI though. I am using the ASP.NET Core + Angular solution.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @atideveloper

    Could you share your ABP Nuget package version ?

  • User Avatar
    0
    atideveloper created

    @ismcagdas It looks to be 5.3.0.

    I created the Demo application that I am working with via ASP.NET Zero on March 11-13th it looks like to give you a timeframe of the code I am working with. I have not updated any nuget packages in any of the projects either. Thanks!

  • User Avatar
    0
    maliming created
    Support Team

    hi atideveloper

    Can you reproduce the problem on the zero demo website?

  • User Avatar
    0
    atideveloper created

    @maliming It doesn't look like it can be reproduced there. I created a new demo tenant (ati) and went throught the steps and the user no longer shows the Role that was assigned to the OU. Fixed in a newer build of ABP that 5.3.0?

  • User Avatar
    0
    maliming created
    Support Team

    I remember this problem is related to zero.

    Can you download the latest zero demo project and try to reproduce it? (v8.5.0) https://aspnetzero.com/Download

  • User Avatar
    0
    atideveloper created

    Tested in ASP.NET Zero 8.7.0 and it seems to be working correctly now.

    Thanks!