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

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

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.
    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    kasem created

    Thank you

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • 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?

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • 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.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • 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.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    ismcagdas created
    Support Team

    @Kasem that would be easier for you :)

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)