EquinoxProject icon indicating copy to clipboard operation
EquinoxProject copied to clipboard

Support for Multi Tenancy

Open Tabgyn opened this issue 7 years ago • 11 comments

I would like to know if you have plans to add support for multi tenancy.

Tabgyn avatar Aug 11 '17 16:08 Tabgyn

It's a good idea, I'll think about.

EduardoPires avatar Aug 11 '17 22:08 EduardoPires

When V3 will be visible ? IdentityServer and MultiTenancy needed :)

regards

CanMehmetK avatar Feb 02 '18 11:02 CanMehmetK

In the meantime: Where should multitenancy authorization sit? As it has to access the resource, it looks like it should call AuthService inside the Repository but is it in line with the patterns ? Auth has to check the tenantId of the resource and compare it with user tenantId... Can anyone help?

murbanowicz avatar Feb 05 '18 10:02 murbanowicz

I solved with this. but needs caching,Injectable to views/layouts ext. by the way saves the day 👍 Contributers of this project will do better , i am sure on that.

Startup ;
services.AddScoped(typeof(TenantAttribute));

Controller [ServiceFilter(typeof(TenantAttribute))] [Area("Management")] public class UserController : BaseController { .... } Attribute public class TenantAttribute : ActionFilterAttribute { private readonly EquinoxContext _dbContext; public TenantAttribute(EquinoxContext dbContext) { _dbContext = dbContext; }

    public override void OnActionExecuting(ActionExecutingContext actionExecutingContext)
    {

        var fullAddress = actionExecutingContext.HttpContext?.Request?.Headers?["Host"].ToString();
        var tenant = _dbContext.Tenants.Where(t => t.url == fullAddress);           
        actionExecutingContext.RouteData.Values.Add("tenant", tenant);
   }

}

CanMehmetK avatar Feb 05 '18 10:02 CanMehmetK

Take a look at the SaasKit project: https://github.com/saaskit/saaskit I've used it and it met my needs well.

Tabgyn avatar Feb 05 '18 13:02 Tabgyn

Hi Tiago. Have you a online sample (Blog, GitHub, or You Tube) or detailed documentation of SaasKit?

leonardoaguiar avatar Feb 05 '18 13:02 leonardoaguiar

Saaskit looks abandoned

On Mon, 5 Feb 2018, 13:32 Leonardo Ribeiro de Aguiar, < [email protected]> wrote:

Hi Tiago. Have you a online sample (Blog, GitHub, or You Tube) or detailed documentation of SaasKit?

On Mon, Feb 5, 2018, 11:24 Tiago Azevedo Borges [email protected] wrote:

Take a look at the SaasKit project: https://github.com/saaskit/saaskit I've used it and it met my needs well.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub < https://github.com/EduardoPires/EquinoxProject/issues/27#issuecomment-363083395 , or mute the thread < https://github.com/notifications/unsubscribe-auth/AAZCIDEvB2di2cOoU75tkcS-10nroUhKks5tRwEegaJpZM4O03Ii

.

-- Leonardo Ribeiro de Aguiar (11) 9.9680-0260 https://br.linkedin.com/in/leonardoraguiar

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/EduardoPires/EquinoxProject/issues/27#issuecomment-363085414, or mute the thread https://github.com/notifications/unsubscribe-auth/AI80kjI767w_JcRUyZurVP994Zo5l5akks5tRwL5gaJpZM4O03Ii .

murbanowicz avatar Feb 05 '18 14:02 murbanowicz

Even though it seems abandoned, the source code is still there.

This other project uses SaasKit with Asp.net Core and was my starting point: https://github.com/janaks09/NetCoreSaaS

In my account also have a project made from SaaSKit, although incomplete.

Tabgyn avatar Feb 05 '18 21:02 Tabgyn

Thank you

leonardoaguiar avatar Feb 05 '18 21:02 leonardoaguiar

@leonardoaguiar

Edit your comment and remove your cellphone :)

brunobritodev avatar May 16 '21 04:05 brunobritodev

@leonardoaguiar

Edit your comment and remove your cellphone :)

Done. Thank you.

leonardoaguiar avatar May 17 '21 11:05 leonardoaguiar