Has anyone successfully implemented multi-tenancy with users being defined only once and not using the "Linked Accounts" feature.
Thanks
4 Answer(s)
-
0
@sedulen do you want users to be unique amont all tenants ? If so, you can use AbpUserAccounts table and create a unique index on that table.
Or you can check user's existance before a user creation on AbpUserAccounts table.
-
0
@ismcagdas I'm not sure how I would use the AbpUserAccounts table vs the AbpUsers table. Ideally we would define all users in the AbpUsers or AbpUserAccounts table in the HOST database and then we would grant access of users to Tenants through the AbpUserRoles table but then I think we would have issues with how the user's profile information is managed since we would need that information to be retrieved from the Host instance information, rather than from the Tenant information.
-
0
What's the point of user uniqueness among the tenants? It's out of multi-tenancy usage. If you really want to do that; you can check an existing user in UserRegistrationManager.cs > RegisterAsync() method and throw exception if there is an existing user.
Something like this;
using (_unitOfWorkManager.Current.DisableFilter(AbpDataFilters.MayHaveTenant )) { var existingUser = _userManager. GetUserOrNull(...); if(existingUser != null){ throw UserFriendlyException("oops, already registered!") } }
-
0
In corporate usage its very normal. You segment clients data to own databases for isolation, internal users need to access multiple clients data to perform tasks. Having multiple accounts is annoying especially since you need to maintain roles and permissions cross clients, and when you on board a new client configure again. Ideally you would have to have a master set of users and limit their client access.