I’m facing a permission issue with a many-to-one relationship and would like to know if there’s a recommended approach to handle this.
Scenario
-
I have a
coursescollection with a many-to-one relationship to astudentscollection (courses.student). -
Access to the
studentscollection is restricted for certain users.
Problem
-
When users don’t have read permission on
students, the relation field incoursesshows a “relationship not configured” error. -
If I grant read access to
students, the relation works—but users can then see all fields from thestudentscollection.
Requirement
I need to achieve the following:
-
A user should be able to see all fields of their own student record.
-
For other students, they should only see limited fields (e.g.,
first_name,last_name). -
The relation field (
courses.student) should work without errors.
Challenge
From what I understand, field-level permissions in Directus apply at the role level, so:
-
If I restrict fields → it affects even the user’s own record.
-
If I allow full access → it exposes all fields for all students.
Question
Is there a way in Directus to:
-
Apply conditional field-level visibility (full access for own record, limited for others), or
-
Properly handle this use case without duplicating collections or breaking the relationship field?
If not, what would be the recommended pattern for this kind of requirement?
Thanks in advance!