Base solution for your next web application
Open Closed

AbpUserOrganizationUnits records while adding users in two ways #6361


User avatar
0
fguo created

While adding an user, I have two ways to link her to OU. I realized it generates different records in AbpUserOrganizationUnits.

If I add members in Organization Units screen, only one record is inserted into DB table AbpUserOrganizationUnits, which links the UserId with one OU Id.

If I add an OrganizationUnit to a user in User screen, multiple records are inserted into DB table AbpUserOrganizationUnits, which link the UserId with her OU Id AND all of that OU's parent Ids.

I wonder which way is correct? Is there any different impact to other parts of application?


7 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @fguo

    If I add members in Organization Units screen, only one record is inserted into DB table AbpUserOrganizationUnits, which links the UserId with one OU Id.

    It shouldn't work like that.

    Could you share information below for your project ?

    • Your AspNet Zero version.
    • Your AspNet Zero project type (Angular or JQuery)

    Thanks,

  • User Avatar
    0
    fguo created

    I use Core+Angular. I tried version 5.0 and 6.4. It acts same on both versions.

    BTW, The interface screens are different on these two ways:

    In User screen, when I check off an OU, its parent OUs are automatically checked off. I can manually uncheck any of them, but I don't know if it should be.

    In OU Add Member screen, there is no such option to check/uncheck its parent OUs.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @fguo

    Sorry, I got you wrong at the first place. Yes, Organization Units screen works like that. It adds users to a specific OU. So this action creates 1 to 1 record for each seleceted user.

    On the other hand, user create & edit dialog adds a single user to multiple OUs.

    This is by design.

  • User Avatar
    0
    fguo created

    Thank you for confirmation! My question is which one is correct. I am concerning the user to its "parent OUs" relationship. Shall I keep relationships for a user to its immediate OU AND all its parent OUs, or just ignore the relationships to parent OUs?

    I surely like the simple user-immediate-OU relationship, but I worry if it encounters problems on other parts of this application (AspNetZero). If this is by design, do you have specific purposes for both?

    Thanks,

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @fguo

    Actually we can say that both are correct but designed to be used for different purposes. The one in Organization Unit page is adding multiple users to a specific OU, other one on the user creatae&edit is for adding a single user to multiple OUs.

  • User Avatar
    0
    fguo created

    I understand "multiple users to a specific OU" and "single user to multiple OUs". No question about that. My question is about PARENT OUs. Is it necessary to link a user to its immediate OU** and ** all of its PARENT OUs?

    From above answers, I assume it has no impact to other parts within current AspNetZero template. However, it should be kept in mind to expand it to my own applications.

    Thanks again.

  • User Avatar
    0
    ismcagdas created
    Support Team

    @fguo

    You are right. AspNet Zero doesn't use OUs for any bussiness case. Probably that is why there are such different implementations.

    I will talk this issue with the team next week.