fix: resolving path for shared item leaks parent info

when an item is shared, their path should stop at the closest directory
that is shared. eg if file c is in shared dir b which is in private dir
a, its public facing path should be b/c, not a/b/c. internally, the real
path is still a/b/c.
This commit is contained in:
2025-12-27 20:25:54 +00:00
parent bac21166fb
commit eca3b95c3e
2 changed files with 5 additions and 4 deletions

View File

@@ -823,7 +823,7 @@ func (vfs *VirtualFS) RealPath(ctx context.Context, db bun.IDB, node *Node, scop
} else if !ok {
return nil, ErrAccessDenied
}
return buildNoteAbsolutePath(ctx, db, node)
return buildNodeAbsolutePath(ctx, db, node, scope.RootNodeID)
}
func (vfs *VirtualFS) PermanentlyDeleteFiles(ctx context.Context, db bun.IDB, nodes []*Node, scope *Scope) error {