Update relationship_not_setup wording to clarify it may also result from missing permissions#26918
Merged
AlexGaillard merged 4 commits intodirectus:mainfrom Mar 27, 2026
Conversation
Member
|
I understand @robluton stated this should be a backend fix but I believe this will potentially expose information about relationships. I wonder if we can simply fix this by updating the |
Contributor
|
@ComfortablyCoding I like your thinking here. Nice and simple. |
ComfortablyCoding
previously requested changes
Mar 26, 2026
Member
ComfortablyCoding
left a comment
There was a problem hiding this comment.
See above comments.
…on case Instead of adding backend logic to distinguish between misconfigured relationships and missing permissions, update the translation string to cover both scenarios as suggested in PR review. Closes directus#21337
73cb3a1 to
b0d581d
Compare
relationship_not_setup wording to clarify it may also result from missing permissions.
ComfortablyCoding
approved these changes
Mar 27, 2026
Member
ComfortablyCoding
left a comment
There was a problem hiding this comment.
Thanks LGTM 🚀 and congratulations on your first contribution to directus! 🥳
relationship_not_setup wording to clarify it may also result from missing permissions.relationship_not_setup wording to clarify it may also result from missing permissions
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
When a user lacks read permission on a related collection, the relational interfaces (M2O, O2M, M2M, M2A, Files) showed "The relationship hasn't been configured correctly" — which is misleading since the relationship is correctly configured, the user simply doesn't have access.
This is a follow-up to #26837 with the backend fix requested by reviewers.
What changed
Backend (
api/src/services/relations.ts):filterForbidden()to differentiate between two cases:related_collection_readable: falseTypes (
packages/types/src/relations.ts):related_collection_readable?: booleanfield to theRelationtypeFrontend composables:
relationMissingPermissionscomputed property touse-relation-m2o.ts,use-relation-o2m.ts,use-relation-m2m.ts, anduse-relation-m2a.tsthat checks the explicit backend flagrelationInforeturnsundefinedwhenrelated_collection_readable === falseto prevent downstream errorsFrontend interfaces:
relationMissingPermissionsis trueTranslation:
relationship_missing_permissionskey toen-US.yamlCloses #21337
Key design decisions
filterForbidden()on the backend — the root cause — rather than inferring permission issues frommeta.specialon the frontendrelated_collection_readablefield is optional and backwards compatible — existing consumers that don't know about it will just ignore itTest plan