0
kasem created
Hi!
Two questions about OrganizationUnits:
- Is there some reason UserId in UserOrganizationUnits isn't a foreign key to User entity?
- 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)
-
0
Hi,
- Please check #1532@25c46b7b-3f12-4f13-8136-d46352d53e36
- This is hard to achieve I think. You can try like that but you also need to change/override some ABP classess like OrganizationUnitManager.
-
0
Thank you
-
0
One related question, I'm planning to allow users switch between their different assigned roles. Do you have instructions about this somewhere?
-
0
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.
-
0
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.
-
0
@Kasem that would be easier for you :)