-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
Describe the Bug
The problem
If you are using multi-tenant plugin and try to create a collection marked with isGlobal: true
in the config you will not be able to do so on account with userHasAccessToAllTenants: true
. For some reason when the global collection is created "Assigned Tenant" default value is not set to the tenant you are currently on. To make things even worse the "Assigned Tenant" field is also disabled by default so you are unable to publish the collection at all from the account with userHasAccessToAllTenants: true
.
Video
Here is the video of the described issue. I am trying to create a Layout
document which is marked with isGlobal: true
in my @payload/multi-tenant-plugin
config. The only mistake I did in the video is that I didn't select the top right tenant field to be "New Tenant", but I've confirmed that doing so does not fix the problem or set the "Assigned Tenant" value to the selected tenant.
2025-09-10.19-31-17.mp4
As you can see global collections become useless for the "super admin" user, since you aren't be able to create them from such account.
Workaround
I've also found the hacky workaround which may help you triangulate the issue, but I am fairly certain that the problem is a lack of generator function for the default value of "Assigned Tenant" field or at least the option for the field to not be disabled on isGlobal: true
collections. Either way the hack is to publish the document by creating a new user with userHasAccessToAllTenants: false
and add it to the tenant where you want to create the global collection on. This way the admin does not show the "Asssigned Tenant" field and you are able to publish the document normally.
Link to the code that reproduces this issue
.
Reproduction Steps
- Create payload app
- Add multi-tenant plugin and configuration
- Add a collection marked with
isGlobal: true
- Set
userHasAccessToAllTenants: true
for the user - Try to create/publish a global collection
- You will end up with the issue described above where the "Assigned Tenant" field is empty, while the UI blocks the publish request due to it requiring a value which you are not able to set due to the field being disabled
Which area(s) are affected? (Select all that apply)
plugin: multi-tenant
Environment Info
Binaries:
Node: 22.14.0
npm: N/A
Yarn: N/A
pnpm: 10.5.2
Relevant Packages:
payload: 3.55.0
next: 15.5.2
@payloadcms/db-postgres: 3.55.0
@payloadcms/email-nodemailer: 3.55.0
@payloadcms/graphql: 3.55.0
@payloadcms/live-preview: 3.55.0
@payloadcms/live-preview-react: 3.55.0
@payloadcms/next/utilities: 3.55.0
@payloadcms/payload-cloud: 3.55.0
@payloadcms/plugin-cloud-storage: 3.55.0
@payloadcms/plugin-multi-tenant: 3.55.0
@payloadcms/plugin-seo: 3.55.0
@payloadcms/richtext-lexical: 3.55.0
@payloadcms/storage-s3: 3.55.0
@payloadcms/translations: 3.55.0
@payloadcms/ui/shared: 3.55.0
react: 19.1.1
react-dom: 19.1.1
Operating System:
Platform: win32
Arch: x64
Version: Windows 11 Pro
Available memory (MB): 32689
Available CPU cores: 16