You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@rustynwac -- this functionality actually just got into Payload core. We'll need to upgrade to the latest version and it's still pretty new / seems to have some minor bugs that are getting fixed.
So we can turn this on pretty easily but I don't think it's necessary for launch but let me know if you think otherwise.
If it is really easy, I would love to turn this on to build the media organization structure as we load content. It seems like that will be easier than organizing all the media afterwards.
If it is really easy, I would love to turn this on to build the media organization structure as we load content. It seems like that will be easier than organizing all the media afterwards.
Seems reasonable to add this to me. I'd like to wait until #571 is merged and then we can play around with this more and see what the implications are to the UI.
Category: enhancement Summary: Enable Payload's native folder organization on the Media collection, scoped per-tenant.
Current behavior:
The Media collection (slug media) presents a flat, tenant-filtered list with no way to group assets into folders. Payload (currently 3.81.0) ships native folder support, but it is entirely off here — there is no top-level folders config and no folders option on any collection.
Desired behavior:
Editors can organize media into folders in the admin, and folders are strictly tenant-scoped — a user in one avalanche center only sees and assigns folders belonging to their own tenant. This scoping is the crux of the issue: Payload auto-creates a single global folders collection (default slug payload-folders) that has no tenant field and is not covered by the existing tenant list filter, so simply flipping the feature on would let every tenant see and reassign every other tenant's folders — a data-isolation bug that must not ship.
Key interfaces:
Enable folders: true on the Media CollectionConfig.
Add the top-level folders config to the Payload config. Note this root config is marked experimental upstream ("may change in minor versions") — call it out in the PR. Use its collectionOverrides hook to inject the tenant relationship field, the tenant list filter, and tenant-aware RBAC access into the generated folders collection, mirroring how every other tenant-scoped collection is assembled (the repo's tenantField() + filterByTenant base-list-filter pattern; the home-grown tenancy layer, not @payloadcms/plugin-multi-tenant).
Add the generated folders collection's slug to the tenant deprovision hook's list of tenant-scoped collections so folders cascade-delete with their tenant (avoids SQLite FK errors on tenant deletion).
Schema change → generate a migration (SQLite adapter) and run pnpm generate:types.
Acceptance criteria:
Media documents can be placed into and moved between folders in the admin UI.
A user in tenant A cannot see, select, or assign a folder created under tenant B.
Deleting a tenant removes its folders with no foreign-key errors.
A migration is generated and pnpm migrate:check passes.
pnpm generate:types has been run and folder types are present; pnpm seed:standalone completes.
Out of scope:
Enabling folders on any collection other than Media (Documents is the obvious follow-up but is a separate issue).
Migrating/auto-sorting existing media into folders.
Any change to the public-facing frontend — this is admin-only organization.
Activity
busbyk commentedon Aug 6, 2025
@rustynwac -- this functionality actually just got into Payload core. We'll need to upgrade to the latest version and it's still pretty new / seems to have some minor bugs that are getting fixed.
So we can turn this on pretty easily but I don't think it's necessary for launch but let me know if you think otherwise.
https://payloadcms.com/docs/folders/overview
andyanderso commentedon Oct 4, 2025
If it is really easy, I would love to turn this on to build the media organization structure as we load content. It seems like that will be easier than organizing all the media afterwards.
busbyk commentedon Oct 5, 2025
Seems reasonable to add this to me. I'd like to wait until #571 is merged and then we can play around with this more and see what the implications are to the UI.
busbyk commentedon Jul 6, 2026
Agent Brief
Category: enhancement
Summary: Enable Payload's native folder organization on the Media collection, scoped per-tenant.
Current behavior:
The Media collection (slug
media) presents a flat, tenant-filtered list with no way to group assets into folders. Payload (currently 3.81.0) ships native folder support, but it is entirely off here — there is no top-levelfoldersconfig and nofoldersoption on any collection.Desired behavior:
Editors can organize media into folders in the admin, and folders are strictly tenant-scoped — a user in one avalanche center only sees and assigns folders belonging to their own tenant. This scoping is the crux of the issue: Payload auto-creates a single global folders collection (default slug
payload-folders) that has no tenant field and is not covered by the existing tenant list filter, so simply flipping the feature on would let every tenant see and reassign every other tenant's folders — a data-isolation bug that must not ship.Key interfaces:
folders: trueon the MediaCollectionConfig.foldersconfig to the Payload config. Note this root config is marked experimental upstream ("may change in minor versions") — call it out in the PR. Use itscollectionOverrideshook to inject the tenant relationship field, the tenant list filter, and tenant-aware RBAC access into the generated folders collection, mirroring how every other tenant-scoped collection is assembled (the repo'stenantField()+filterByTenantbase-list-filter pattern; the home-grown tenancy layer, not@payloadcms/plugin-multi-tenant).pnpm generate:types.Acceptance criteria:
pnpm migrate:checkpasses.pnpm generate:typeshas been run and folder types are present;pnpm seed:standalonecompletes.Out of scope:
Add tenant-scoped folders to Media
Add tenant-scoped folders to Media
Add tenant-scoped folders to Media
Add tenant-scoped folders to Media
Add tenant-scoped folders to Media