Skip to content

fix(scope): judge a linked path by its target as well - #2

Merged
elcreator merged 1 commit into
mainfrom
fix-file-groups-through-links
Nov 6, 2026
Merged

elcreator merged 1 commit into
mainfrom
fix-file-groups-through-links

Conversation

@elcreator

Copy link
Copy Markdown
Owner

Problem

file_groups rows are keyed by name, and absoluteOf() follows links. A link inside the root was therefore a second name for a file that carried none of its restrictions: canRead() judged the name of the link, and read() returned the target. A manager outside the group could read, list and write through it.

Change

canRead() and canWrite() now ask about both names, the path given and where it really is. A path that does not exist yet is judged by its nearest existing ancestor, so a write through a linked folder is covered too. A manager who may see the target still reaches it through the link.

Administrators and sites without restrictions take the same early return as before.

Tests

Two new tests with real symlinks: canRead, read, canWrite and listImages for a manager outside the group, and access through the link for a member. The first failed before the fix. Full suite on Linux: 256 passed. Link tests skip on a system that cannot create links, so run them on Linux.

🤖 Generated with Claude Code

File group rows are keyed by name, and absoluteOf() follows a link, so a
link inside the root was a second name that carried none of the restrictions
of the file it reached. canRead() and canWrite() now ask about both names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@elcreator
elcreator merged commit 1b82611 into main Nov 6, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant