Base solution for your next web application
Open Closed

Nested Multitenancy #4923


User avatar
0
lessfriction created

Our host company has multiple tenants.

Then one of those tenants would also have tenants under them as well.

For example,

Host has Tenant a and Tenant b.

Then Tenant b has tenant c and tenant d.

All of these tenants regardless of hierarchy must be in control of the host regarding the subscription and other administrative functions.

I'm thinking in extending the permissions for the Parent tenants and making a linking table between the parent tenant and its tenants. In this example, adding a link between (parent) Tenant b and (child)tenant c and also Tenant b to tenant d.

The host admin will add a tenant management permission available for the Tenant b and will give Tenant b's admin an access to their tenants.

What are your thoughts about this?

May I know how this scenario can be done inside aspnetzero and how much of an effort do we need to make in applying the necessary changes?


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

    Hi,

    I think it is same with <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/3238">https://github.com/aspnetboilerplate/as ... ssues/3238</a>. Have you considered our answer to above github issue ?

    IF you think there are some unclear points, we can try to help.

  • User Avatar
    0
    lessfriction created

    /// <summary> /// If ParentTenantId is null, then it is associated directly to the Main Host Tenant. /// </summary> public virtual int? ParentTenantId { get; set; }

        [ForeignKey("ParentTenantId")]
        public virtual Tenant ParentTenant { get; set; }
    
        /// &lt;summary&gt;
        /// Associate Parent Tenants to its Children Tenants
        /// &lt;/summary&gt;
        public virtual ICollection&lt;Tenant&gt; Children { get; set; }
    

    I am implementing the extension of the Tenants with something like this.

    I think it's somehow similar to the Organization Units wherein they have root and children.

    Any thoughts?

  • User Avatar
    0
    ismcagdas created
    Support Team

    @lessfriction I think it seems fine.