Base solution for your next web application
Open Closed

OrganizationUnits issue #4741


User avatar
0
kasem created

Hi!

Two questions about OrganizationUnits:

  1. Is there some reason UserId in UserOrganizationUnits isn't a foreign key to User entity?
  2. I think it's more useful to refer users in UserOrganizationUnits to AbpUserRoles, because the system supports multiple roles for the same user, and sometimes you want the same user to be in "Unit A" on his first role "User" while on his "Admin" role on "Unit B" for example. What's the minimum change I can do to achieve this? should I create a new FK entity or just override UserId in UserOrganizationUnits to be a FK to AbpUserRoles?

Thanks


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

    Hi,

    1. Please check #1532@25c46b7b-3f12-4f13-8136-d46352d53e36
    2. This is hard to achieve I think. You can try like that but you also need to change/override some ABP classess like OrganizationUnitManager.
  • User Avatar
    0
    kasem created

    Thank you

  • User Avatar
    0
    kasem created

    One related question, I'm planning to allow users switch between their different assigned roles. Do you have instructions about this somewhere?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @Kasem,

    We don't have instructions about such a usage. Currently, ABP Framework considers all roles of the current user. If you want to change that behaviour, you need to override ABP Framework's default behaviour. I'm not sure if this is possible at all.

  • User Avatar
    0
    kasem created

    Thanks @ismcagdas for your quick response.

    I understand. In that case, I'll try to use the approach of directing users to own multiple linked accounts instead.

  • User Avatar
    0
    ismcagdas created
    Support Team

    @Kasem that would be easier for you :)