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
{{ message }}
Repository navigation
fix: thread overrideAccess into beforeChange in global update - #18675
Pass overrideAccess from the global update operation into beforeChangeArgs during field validation, establishing bit-for-bit parity with packages/payload/src/collections/operations/utilities/update.ts.
Since 3.90, validateFilterOptions queries relationship records with overrideAccess: overrideAccess ?? false.
While the collection update utility (packages/payload/src/collections/operations/utilities/update.ts line 125) properly forwards overrideAccess into �eforeChangeArgs, the global update operation (packages/payload/src/globals/operations/update.ts lines 350–361) destructured overrideAccess from �rgs but omitted it when constructing �eforeChangeArgs.
Consequently:
Local API calls such as payload.updateGlobal(...) (where overrideAccess defaults to rue) had their overrideAccess flag dropped before reaching field-level hooks.
Inside �eforeChange, overrideAccess defaulted to undefined, causing relationship ilterOptions to execute queries with overrideAccess: false (as unauthenticated / anonymous).
Any global relationship targeting a collection with default access (requiring authentication) failed during Local API calls (e.g. seeds, CLI scripts, background workers) with ValidationError: The following field is invalid: .
How?
Explicitly forward overrideAccess into �eforeChangeArgs in packages/payload/src/globals/operations/update.ts:
PINYOPATTANAWASANPORN
changed the title
fix(payload): thread overrideAccess into beforeChange in global update (#18674)
fix: thread overrideAccess into beforeChange in global update
Oct 13, 2026
Global updates now pass the caller's access-override setting into relationship validation, as collection updates already do. This fixes validation failures for updates made without a user when the override is set. The change is small and low risk, and nothing blocks merging.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the change accurately: it threads overrideAccess into beforeChange in the global update operation. The raw summary confirms the single-line change in packages/payload/src/globals/opera…
Linked Issues check
Issue #18674 requires that the global update operation forward overrideAccess into beforeChangeArgs, matching the collection update path. The PR summary for packages/payload/src/globals/operations/upd…
Out of Scope Changes check
The only reported code change is one added property (overrideAccess) in the global update operation's beforeChangeArgs. This directly serves #18674. The PR summary reports no other files changed. The …
Description check
The description explains the change: forwarding overrideAccess from the global update operation into beforeChangeArgs so it matches the collection update path. It gives the cause (validateFilterOption…
Full details: Title check
Explanation
The title names the change accurately: it threads overrideAccess into beforeChange in the global update operation. The raw summary confirms the single-line change in packages/payload/src/globals/operations/update.ts that forwards overrideAccess into beforeChangeArgs. The title is specific and short, and it matches the linked issue #18674 objective.
Full details: Linked Issues check
Explanation
Issue #18674 requires that the global update operation forward overrideAccess into beforeChangeArgs, matching the collection update path. The PR summary for packages/payload/src/globals/operations/update.ts reports a +1/-0 change that adds overrideAccess to beforeChangeArgs. The PR description states the same change. This implements the single requirement in #18674. The issue does not request an automated test. The repository diff and file reads were unavailable, so this verdict relies on the PR summary and description, not on direct code inspection.
Full details: Out of Scope Changes check
Explanation
The only reported code change is one added property (overrideAccess) in the global update operation's beforeChangeArgs. This directly serves #18674. The PR summary reports no other files changed. The repository diff was unavailable, so the absence of other changes rests on the PR summary alone.
Full details: Description check
Explanation
The description explains the change: forwarding overrideAccess from the global update operation into beforeChangeArgs so it matches the collection update path. It gives the cause (validateFilterOptions defaulting to overrideAccess ?? false since 3.90), the affected Local API case, the exact one-line diff, and a link to the issue it fixes. It is related to the changeset and specific enough to pass.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Library detection encountered an error. Review will continue without library-specific context.
The configuration directory could not be loaded. This review used the available YAML and UI settings; directory instructions and checks were not evaluated.
Git: CodeRabbit could not clone the repository, so clone-backed analysis was skipped and this review may be incomplete. Verify repository clone access, such as SSH credentials, before requesting another full review. If clone access is intentionally unavailable, use path_filters to narrow the review scope.
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.
Reviewing files that changed from the base of the PR and between d052268 and 275407c.
Files selected for processing: 1
packages/payload/src/globals/operations/update.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Pass overrideAccess from the global update operation into beforeChangeArgs during field validation, establishing bit-for-bit parity with packages/payload/src/collections/operations/utilities/update.ts.
Why?
Resolves #18674.
Since 3.90, validateFilterOptions queries relationship records with overrideAccess: overrideAccess ?? false.
While the collection update utility (packages/payload/src/collections/operations/utilities/update.ts line 125) properly forwards overrideAccess into �eforeChangeArgs, the global update operation (packages/payload/src/globals/operations/update.ts lines 350–361) destructured overrideAccess from �rgs but omitted it when constructing �eforeChangeArgs.
Consequently:
How?
Explicitly forward overrideAccess into �eforeChangeArgs in packages/payload/src/globals/operations/update.ts:
s const beforeChangeArgs = { collection: null, context: req.context, data, doc: publicationHookDoc, docWithLocales: globalJSON, fieldsToValidate: submittedTopLevelFieldNames, global: globalConfig, operation: 'update', overrideAccess, req, skipValidation: isSavingDraft && !hasDraftValidationEnabled(globalConfig), } satisfies BeforeChangeArgs<JsonObject>Verification & Parity
s const beforeChangeArgs: Args<DataFromCollectionSlug<TSlug>> = { ... operation: 'update', overrideAccess, req, ... }Fixes #18674