payload-locked-documents: fixed access lets a user of one tenant read, create and delete lock rows of another tenant
Maintainers usually reply within 1 day
@JarrodMFlesch is already working on this.
Since Nov 18, 2026.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- node.js, postgresql, typescript
- Domain
- authorization, backend, databases
Research direction
Start with getLockedDocumentsCollection and the reproduction branch's REPRO.md and integration test, tests/int/locked-documents.int.spec.ts. Trace how the collection sets access for read, create, update, and delete, then compare those paths with the tenant-scoped page access checks. Done when tenant A cannot read, create, or delete tenant B's lock rows and the reproduction test passes.
Written by the indexing model from the issue text.
Description
Describe the Bug
getLockedDocumentsCollection sets fixed access for read, create, update and delete, and the config can't change it. with the multi-tenant plugin, a user of tenant A can list tenant B's lock rows. they see the document id and the editor's user id. population is blocked.
they can also create or delete lock rows on tenant B's documents. this can block editing for tenant B.
can the collection take access overrides, or check read access on the locked document? seen on 3.94.0.
Link to the code that reproduces this issue
https://github.com/MRNAQA/payload-repros/tree/locked-documents-tenants
Reproduction Steps
Branch locked-documents-tenants is the blank template plus @payloadcms/plugin-multi-tenant, a tenants collection and a tenant-scoped pages collection. REPRO.md has the full output.
cp .env.example .envdocker compose up -d(Postgres 17)pnpm installpnpm test:int tests/int/locked-documents.int.spec.ts
The test creates tenant A with user A and tenant B with user B, a tenant B page, and the lock row that the admin writes while user B edits that page. Then, as user A (overrideAccess: false):
- read the tenant B page: rejected (control, passes)
- list
payload-locked-documents: returns user B's row - create a lock row on the tenant B page: succeeds
- delete user B's lock row: succeeds
FAIL ... > user A does not see the tenant B lock row
AssertionError: expected [ { id: 1, document: { …(2) }, …(4) } ] to deeply equal []
+ "document": { "relationTo": "pages", "value": 1 },
+ "user": { "relationTo": "users", "value": 2 },
FAIL ... > user A cannot lock the tenant B page
AssertionError: promise resolved "{ id: 2, document: { …(2) }, …(4) }" instead of rejecting
FAIL ... > user A cannot delete the tenant B lock row
AssertionError: promise resolved "{ id: 1, document: { …(2) }, …(4) }" instead of rejecting
Tests 3 failed | 1 passed (4)
The REST API gives the same result as user A: GET /api/pages/1 is 404, GET /api/payload-locked-documents is 200 with the row, POST is 201 and DELETE is 200.
Which area(s) are affected?
area: core, plugin: multi-tenant
Environment Info
Binaries:
Node: 24.22.3
npm: 11.19.1
Yarn: N/A
pnpm: N/A
Relevant Packages:
payload: 3.94.0
next: 16.4.6
@payloadcms/db-postgres: 3.94.0
@payloadcms/drizzle: 3.94.0
@payloadcms/graphql: 3.94.0
@payloadcms/next/utilities: 3.94.0
@payloadcms/plugin-multi-tenant: 3.94.0
@payloadcms/richtext-lexical: 3.94.0
@payloadcms/translations: 3.94.0
@payloadcms/ui/shared: 3.94.0
react: 19.2.9
react-dom: 19.2.9
Operating System:
Platform: darwin
Arch: arm64
PostgreSQL: 17.12
- Dominant language
- TypeScript
- Stars
- 45.8k
- Forks
- 4.4k
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 251
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from payloadcms/payload
-
db-d1-sqlite: upsert is aliased to updateOne, so payload.kv.set never inserts new keysPossibly taken @pcbeingused333 claimed this today. OpenBug db: d1-sqlite Payload OSS
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
payloadcms/payload#19766 ·
Maintainers usually reply within 1 day
-
Document bar (.doc-controls__content) overflows a 375 px viewport, clips "Created" and fails axe scrollable-region-focusablePossibly taken A pull request linked to this issue is open or already merged. Openarea: ui Bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
payloadcms/payload#19690 ·
Maintainers usually reply within 1 day
-
[v4] Blocks thumbnails croped 3:2Possibly taken @samiarif02 claimed this 2 days ago. Openarea: ui Bug Payload OSS status: needs-triage v3
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
payloadcms/payload#19609 ·
Maintainers usually reply within 1 day
-
Scheduled publish jobs are not deleted when their document is deleted (string id in the job, raw id in the cleanup)Possibly taken @volodymyrshk claimed this 10 days ago. Openarea: core Bug db: sqlite
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
payloadcms/payload#19448 ·
Maintainers usually reply within 1 day
-
plugin-multi-tenant: `isGlobal` collections redirect tenant-scoped users to `/admin` since 3.93.0 (GlobalViewRedirect prop-name mismatch)Possibly taken @JarrodMFlesch claimed this 10 days ago. OpenBug plugin: multi-tenant
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
payloadcms/payload#19420 · 1 assignee ·
Maintainers usually reply within 1 day
All issues in payloadcms/payload
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
milind-soni/OpenMausBot#6730 ·
Maintainers usually reply within 1 day
-
`@angular/[email protected]` depends on vulnerable Vite 7.3.7 - GHSA-p4f5-76q4-ffq7 (Critical RCE)Openarea: @angular/build
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
angular/angular-cli#34764 ·
Maintainers usually reply within 1 day
-
status/need-triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
google-gemini/gemini-cli#30384 · 1 comment ·
Maintainers usually reply within 1 day
-
P2
Difficulty 1/5 Under an hour Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
area:image documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day