Base solution for your next web application
Open Closed

Sharing Data in Multi Tenant Applications. #2869


User avatar
0
codenewa created

I'm currently working on a multi-tenant application where the host admin can create data that can be consumed by the users in the tenants. However, the data created by the tenants would not be available to other tenants.

I think that the IMayHaveTenant interface can be used to make allow the data created by the host to be consumed by the tenants. Is that correct?

Thank you for the guidance.


3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    If you want to create a common entity (data) which will be shared for all tenants and host, you must not use IMayHaveTenant or IMustHaveTenant.

    In that case, all tenants and host can query/edit/delete this entity.

    Please let us know if your case is different.

    Thanks.

  • User Avatar
    0
    codenewa created

    Scenario:

    In the application, the host creates entities: Package1, Package2. There are Tenants => Tenant1, Tenant2 Host assigns packages to tenants. So, we have tenantpackages: TP1 => Tenant1+Package1 for Tenant 1 TP2 => Tenant1+Package2 for Tenant 1 TP3 => Tenant2+Package1 for Tenant 2

    Tenant1 also creates a new package: Package3 which will create a tenantPackage entity (TP4=> Tenant1+Package3).

    Here, Tenant1 has full control over Package3. But neither Host nor Tenant2 are able to see Package3. So, Host won't be able to create a tenantpackage (TP5) such that TP5= Tenant2+Package3.

    To allow for this, I was thinking following.

    1. Package will be IMayHaveTenant because it can be created by both Host and Tenants, but only the creator can update them.
    2. TenantPackage will be IMustHaveTenant because it needs to have a tenant and other tenants shouldn't see it.

    Am I going in the wrong direction?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    In your scenario this is a very good solution. I didn't understand it in your first post, sorry :).

    Thanks.