I have a question regarding some functionality within Strapi.
So, we are going to use Strapi. And we will have one instance of Strapi deployed to Azure (e.g AppService). However, we have multiple clients/organizations. Is it possible to implement a multitenancy approach: admins of the organization will login to strapi however they will see only their content.
How we can do it? And if yes, is it included into free pricing plan?
This is an interesting question. The only thing that comes to mind that we are doing now is by creating custom roles in the Admin area, you can quite granularly select which content types etc. that each role has visible to them. In this way you could sort of customize what each user sees, content-wise, when they log in by applying different roles for them.
If you’re looking for a completely customized experience, with different logos, colors, or whatever then that may be doable using a custom function that runs at login to apply different settings.
Strapi doesn’t support multitenancy out of the box, unfortunately.
There are different approaches to this, e.g. (pic taken from this article, I didn’t read it though ).
In our project, we implement it manually “by hands”, e.g. by creating a “tenant” collection (the actual name is “brand” - coz we approach this as multi-branding, where different tenants can have 1 or more brands/branded sites in CMS) with all other collections relating to the mentioned collection.
But we are still in the active development stage, so no custom roles yet to filter content “per brand/tenant”.
Ideally, this could be built into the Strapi core, enabling it to be “more enterprise-friendly”. Something like this flow would fit the needs more than enough:
- Tenant-1 has access to single Brand-1
- He logs in to Strapi
- Whole contents of Strapi filtered to display records related to Brand-1
- Tenant-2 has access to two Brand-2 and Brand-3
- He logs in to Strapi
- And immediately after login he is presented with a modal prompt to select the desired brand
- Whole contents of Strapi filtered to display only selected brand
- But there is a UI element nearby to change brand selection
Adjusting Strapi UI (logo, theme, etc) to visually differentiate between brands is desirable, but is not mission-critical.
Obviously, data structure should be aligned between all tenants, I hardly imagine sustained business otherwise.
For a business-grade product, one “simple” solution is to give each client their own table in a share db instance. The schema is shared among all users, and the rest or graphql calls from the client/middleware can easily accommodate this by using subdomain aliasing. It’s straightforward so long as your DevOps is programmatically managed, like in Terraforms.