admin icon indicating copy to clipboard operation
admin copied to clipboard

Multiple tenants support

Open kravemir opened this issue 6 years ago • 2 comments

Does qor/admin support multitenancy? It would be useful for building small cheap SaaS used by many or lots of clients. For example, consider following common use-cases:

  • blog - one shared application, one shared database with tables prefixed with tenantId column,
  • eshop - one shared application, one shared database with multiple schemas, or multiple databases.

I have got an idea, which would benefit from multi-tenancy, as it's focused to be cheap solution, where each tenant would be having very light load.

kravemir avatar Aug 03 '19 10:08 kravemir

one shared application, one shared database with multiple schemas, or multiple databases.

I guess, based on General Configuration, that multiple AdminConfig instances would do the job.

one shared database with tables prefixed with tenantId column,

This might require more tweaking, at least:

  • filter visible entries: using Default Scope based on Search & Scopes & Filters documentation,
  • automatically populate tenant_id: I have no clue,..

kravemir avatar Aug 03 '19 11:08 kravemir

you should add tenant_id field to every model. than you can filter via default scope.

lutfuahmet avatar Oct 24 '20 10:10 lutfuahmet