Granular access to files depending on other collections

Hello,

I’m currently trying out Directus for one of my projects. I have the following simplified structure.
There is a projects collection, and each project can have multiple files files attached. Additionally, the projects collection has a assignedToUser field, which contains a reference to a directus system user.

Now I want to create an access policy, so that a user with this policy can only see files that are linked to the projects he is assigned to. For the policy I have set up access to the projects and project_files collections by just checking if the assignedUser.id field is equal to the current user. However, to see and odnwload the files, he also needs access to the system files table on these specific files. How would I set up a filter condition there, so the user is not able to see all files?

Hello,

In the projects collection if you use the files interface which will create a junction table and a field in the directus_files your problem will be solved.