From f12487d0367d37a86783559648cbdf5b1c9a3b46 Mon Sep 17 00:00:00 2001 From: Grendgi Date: Tue, 16 Jun 2026 13:45:15 +0300 Subject: [PATCH] fix: show shared folder contents consistently --- internal/repository/node.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/repository/node.go b/internal/repository/node.go index c2cc950..0bd92f6 100644 --- a/internal/repository/node.go +++ b/internal/repository/node.go @@ -51,7 +51,10 @@ func (r *NodeRepository) List(ctx context.Context, userID string, subordinateIDs switch scope { case "shared": - where = append(where, `n.owner_user_id <> $1 AND ( + if parentID == nil || *parentID == "" { + where = append(where, "n.owner_user_id <> $1") + } + where = append(where, `( has_node_access(n.id, $1) OR n.owner_user_id::text = ANY($2::text[]) )`)