Where to store multi-tenant info?

Where to store multi-tenant info?

Old forum URL: forums.lhotka.net/forums/t/10881.aspx

StefanCop posted on Tuesday, November 15, 2011

In our system a user can access data of one or multiple clients (tenant). The IDs of all tenants, he is allowed to work with, are fetched while loggin in.

(A) Now, where would you store this information for a user, the IDs of which tenants he is allowed to fetch?

(B) And what is the state of an answer to the post back in 2009? (http://forums.lhotka.net/forums/t/8011.aspx)

  Issue 13 is in the running for CSLA 4. In the end some of these things will come down to a matter of time. But multi-tenant business and authz rules are fairly high on my priority list. 

Is this the RoleSet?



RockfordLhotka replied on Wednesday, November 16, 2011

That's a long thread, I don't have time to decipher what was "issue 13". If that was to support multi-tenant business and authz rules, then yes, that is a feature of CSLA 4. The feature is implemented through the concept of rule sets.

StefanCop replied on Thursday, November 17, 2011

Thanks, this answers part (B).
I suspected that this wouldn't solve my modality of multi-tenant.

My solution is to restrict right down in SQL, something like   SELECT ...  WHERE tenantid in (1,2,5,7).
All I have to do is send the "(1,2,5,7)" from client to the sever.
Remmains question (A), where should I store the IDs?


RockfordLhotka replied on Thursday, November 17, 2011

I think those are your two primary options, yes.

If the TenantId concept is a per-user thing I'd probably put the values in the custom identity object.

If the concept isn't directly tied to the user I'd tend to use ClientContext.

Copyright (c) Marimer LLC