fix(directlink): direct link should not be accessible if the parent file is in trash bin (#2415)

This commit is contained in:
Aaron Liu
2025-05-29 09:42:22 +08:00
parent ec53769e33
commit 65095855c1
7 changed files with 62 additions and 41 deletions

View File

@@ -300,25 +300,6 @@ func (n *shareNavigator) ExecuteHook(ctx context.Context, hookType fs.HookType,
return nil
}
// findRoot finds the root folder of the given child.
func (n *shareNavigator) findRoot(ctx context.Context, child *File) (*File, error) {
root := child
for {
newRoot, err := n.baseNavigator.walkUp(ctx, root)
if err != nil {
if !ent.IsNotFound(err) {
return nil, err
}
break
}
root = newRoot
}
return root, nil
}
func (n *shareNavigator) Walk(ctx context.Context, levelFiles []*File, limit, depth int, f WalkFunc) error {
return n.baseNavigator.walk(ctx, levelFiles, limit, depth, f)
}