Repository navigation
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Define access rules packages/payload/src/database/migrations/migrationsCollection.ts |
The collection’s create, read, update, and delete access functions now return false. Comments describe the migration CLI and dev push access behavior. |
Priority:
Estimated code review effort: 2 (Simple) | ~5 minutes
Change: Bug fix · Severity of issue fixed: Medium
Possibly related PRs
- payloadcms/payload#17459: The migration adds a system that reads and writes the
payload-migrationscollection. - payloadcms/payload#19080: The PR changes the
payload migrateCLI and its migration contract, which use the collection’s access override.
Suggested reviewers: paulpopus
Merge Risk: 
Minimal · up to 3ee70
-
The migration collection is denied through access checks without blocking the inspected migration workflows. No merge-blocking issue remains.
Pre-merge checks: 
5
-
Full details: Linked Issues check
-
Explanation
Issue
#19204requires that create, read, update, and delete onpayload-migrationsdeny by default, and that the migration flows keep working. The change at head addsaccesswithcreate,delete,read, andupdateset to() => falseonmigrationsCollection(packages/payload/src/database/migrations/migrationsCollection.ts). Because the collection definesaccess, sanitize no longer appliesdefaultAccessto it. This meets the requested fix. The migration flows do not depend on the access functions.getMigrationscallspayload.findwithoverrideAccess: true, andmigratecallspayload.createwithoverrideAccess: true.migrateStatusreads throughgetMigrations. The migration CLI and dev push are covered by the same Local API path as described in the issue. The PR also reports a reproduction in which/api/accessomits the collection and the enforced find returns 403, whilepayload migrateandmigrate:statusstill work. No coding requirement in#19204remains unmet. The issue's reproduction was not re-run; this assessment relies on the source read and the PR's reported results.
Full details: Out of Scope Changes check
-
Explanation
The whole-PR diff against the merge base changes one file, packages/payload/src/database/migrations/migrationsCollection.ts (+10/-0). The change adds one
accessblock and a comment that explains why the block is needed. Both directly implement the objective in#19204. No unrelated files, refactors, or behavior changes appear in the diff. The comment's claim that only the migration CLI and dev push touch the collection is consistent with the code read ingetMigrations.tsandmigrate.ts.
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
What?
Sets
accesson the internalpayload-migrationscollection so every operation denies.Why?
The collection sets
endpoints: false,graphQL: falseandadmin.hidden, but noaccess, so sanitize fills indefaultAccess(any admin user).GET /api/accessthen reportscreate/read/update/deleteastruefor every logged-in admin user, and a Local API call withoverrideAccess: falseis allowed. Projects can't close it themselves: the collection is pushed during sanitize after plugins run (discussions #15329 and #16461 ask for an override for this reason).How?
Four
() => falseaccess functions onmigrationsCollection. The migration CLI and the dev push go through the Local API withoverrideAccessdefaulting totrue, so no migration flow consults them. Verified on the reproduction in the linked issue: with the same change applied post-sanitize,payload migrateandmigrate:statusstill write and read the table,/api/accessomits the collection, and the enforced find returns 403.Fixes #19204