Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion echo/directus/sync/collections/folders.json
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
[]
[
{
"name": "Public",
"parent": null,
"_syncId": "74232676-80e7-4f8c-8012-c0d59e6d0a24"
}
]
74 changes: 74 additions & 0 deletions echo/directus/sync/collections/permissions.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,80 @@
"policy": "_sync_default_public_policy",
"_syncId": "9d9c2b69-dd1f-4a25-b776-aa81f9c75aa4"
},
{
"collection": "directus_files",
"action": "read",
"permissions": {
"_and": [
{
"_or": [
{
"folder": {
"name": {
"_contains": "Public"
}
}
},
{
"folder": {
"parent": {
"name": {
"_contains": "Public"
}
}
}
},
{
"folder": {
"parent": {
"parent": {
"name": {
"_contains": "Public"
}
}
}
}
}
]
}
]
},
Comment on lines +38 to +75
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

LGTM – permission filter nesting is consistent!
The new directus_files.read rule correctly checks the folder name at three levels of ancestry. You could simplify by removing the redundant outer _and, but consistency with other rules is also valuable. Ensure _contains: "Public" behaves case-insensitively in your Directus version so all “Public” folders (and their ancestors) are captured.

Example flattening:

- "permissions": { "_and": [ { "_or": [ … ] } ] }
+ "permissions": { "_or": [ … ] }

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In echo/directus/sync/collections/permissions.json between lines 38 and 75, the
permission filter for directus_files.read uses an outer _and with a single _or
condition inside, which is redundant. To simplify, remove the outer _and and
keep only the _or array with the three folder name checks. Also, verify that the
_contains operator is case-insensitive in your Directus version to ensure all
relevant "Public" folders are matched.

"validation": null,
"presets": null,
"fields": [
"description",
"id",
"title",
"tags",
"location",
"storage",
"focal_point_divider",
"focal_point_x",
"focal_point_y",
"storage_divider",
"filename_disk",
"filename_download",
"metadata",
"type",
"filesize",
"created_on",
"modified_by",
"modified_on",
"embed",
"uploaded_by",
"uploaded_on",
"folder",
"width",
"height",
"charset",
"duration",
"tus_id",
"$thumbnail",
"tus_data"
],
"policy": "_sync_default_public_policy",
"_syncId": "f5228d52-f3a5-428c-929a-09dcf47d870f"
},
{
"collection": "project_report_metric",
"action": "create",
Expand Down
Loading