Multi-Tenant Globals #3268
Closed
IAmNatch
started this conversation in
Feature Requests & Ideas
Replies: 2 comments 7 replies
-
I think you can achive this already without needing this feature. I would do it like this:
If you got it working I would love to see a demo! You can also have a look to this plugin (https://github.com/joas8211/payload-tenancy) |
Beta Was this translation helpful? Give feedback.
6 replies
-
@IAmNatch I see that it is now included by default in the plugin https://github.com/joas8211/payload-tenancy#globals 🕺 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The Problem
Globals operate as singletons within a single table on the DB, and a single config page for each global within the admin. This works great for single tenant websites, but is tricky to scale into multi-tenant applications.
Since payload advertises (and follows through exceptionally!) as a CMS with strong multi-tenancy capabilities I'm wondering if there are any plans to extend the globals api to include an officially supported multi-tenant globals workflow?
Possible implementation
One way to approach this could be a access control style resolver method which allows developers to provide their own segmentation criteria via either an async function, a boolean, or a
Where
query. This would leave the developer free to segment globals by any field they wish, and based on whichever criteria they prefer.Example
Beta Was this translation helpful? Give feedback.
All reactions