-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WC2-434 Add support for multi-account users #1561
Conversation
I understand we need some users to be in different accounts with different permissions, e.g user
Even if the implementation you're suggesting introduces complexity, I can't think of a better one… I had a quick look on some other solutions but none seems to fit our use case. Some thoughts:
In my opinion, the simplest solution would be to not implement this feature and let users create several accounts when needed. But I guess that's not possible ;) |
In an ideal world, that would be a great idea :D |
8c347ca
to
de9353e
Compare
Not implementing the feature is what we've been doing for years and my argument was that only people internal to bluesquare needed that feature, so we could delay, but now, with the CIAM requirement of WFP there is a need for having access to multiple accounts with a single email address, so, we need to provide a solution although I agree that this brings on some complexity. |
e0c667f
to
fdf32f5
Compare
e54a322
to
4c5785a
Compare
With very rough working "invitation".
If a user request a token to api/token we should look if that user has a tenant_user for the account corresponding to the app_id in the url, and if it’s the case, send a token for that tenant_user on that account instead of the token for the login user.
4c5785a
to
cde6dba
Compare
This PR adds support for multi-account users without breaking the existing user setup.
Note: The main issue is the
auth_user_user_permissions
table, because the permissions are linked to the Djangoauth_user
(which we shouldn't touch) instead of theiaso_profile
, we cannot do proper "user has many accounts" relations.Proposed solution:
auth_user
with the configuration as we know it:This way, a "multi-account user" is actually a "main"
auth_user
that acts as a composition of auth_users, one for each account.Caveats
username
needs to be unique on theauth_user
, this means we need a differentusername
per account. We don't really want this, but we can postfix themain_user
'susername
with theaccount.name
. Currently, I'm not displaying the user'susername
,first_name
,last_name
andemail
, these infos are actually coming from theuser.tenant_user.main_user
so the user has a more coherent experience. This leads to the question of what about editing these new users? I think we should not allow edition of these 4 fields when a user is a multi-account user.Unresolved
TODO
TenantUser
username
Related JIRA tickets : WC2-434, WC2-435
Doc
Print screen / video of current status
Peek.2024-08-19.15-11.mp4