π The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.
Vue dockergolangkanbanknowledge-baseknowledge-managementmarkdownnote-takingnotesnotes-appnotionnuxtnuxtjsoffline-firstoidcpwaselfhostedssovuevuejswiki
Fix comments
Smaug6739019fa21aaee9
diff --git a/backend/services/node.service.go b/backend/services/node.service.goindex 95ff6ab0..888caffc 100644--- a/backend/services/node.service.go+++ b/backend/services/node.service.go@@ -78,9 +78,9 @@ SELECT * FROM user_nodes ORDER BY role, 'order' DESC, name;`, userId)func (s *Service) GetSharedNodes(userId types.Snowflake) ([]*models.Node, error) {var nodes = make([]*models.Node, 0)- // 1. Get all accessible nodes (owned or shared, including children of owned/shared nodes)+ // 1. Get all shared nodes (shared, including children of shared nodes)rows, err := s.db.Query(`- WITH RECURSIVE accessible_nodes AS (+ WITH RECURSIVE shared_nodes AS (SELECT n.id, n.user_id, n.parent_id, n.name, n.description, n.tags, n.role, n.color, n.icon, n.theme,n.accessibility, n.access, n.display, n.order, n.size, n.metadata, n.created_timestamp, n.updated_timestampFROM nodes n@@ -92,9 +92,9 @@ func (s *Service) GetSharedNodes(userId types.Snowflake) ([]*models.Node, error)SELECT c.id, c.user_id, c.parent_id, c.name, c.description, c.tags, c.role, c.color, c.icon, c.theme,c.accessibility, c.access, c.display, c.order, c.size, c.metadata, c.created_timestamp, c.updated_timestampFROM nodes c- JOIN accessible_nodes an ON an.id = c.parent_id+ JOIN shared_nodes an ON an.id = c.parent_id)- SELECT * FROM accessible_nodes;+ SELECT * FROM shared_nodes;`, userId)if err != nil {return nil, errdiff --git a/backend/services/permissions.service.go b/backend/services/permissions.service.goindex ad8d7ba3..d2655ef0 100644--- a/backend/services/permissions.service.go+++ b/backend/services/permissions.service.go@@ -54,7 +54,7 @@ func (s *Service) GetNodePermission(nodeId types.Snowflake) ([]*models.Permissiofunc (s *Service) HasPermission(userId, nodeId types.Snowflake, required int) (bool, int) {var perm int- err := s.db.QueryRow(`+ s.db.QueryRow(`WITH RECURSIVE ancestors AS (-- Start with the given nodeSELECT id, parent_id@@ -81,7 +81,7 @@ func (s *Service) HasPermission(userId, nodeId types.Snowflake, required int) (b// Case 2 : Not enough permissions β check if owner of an ancestorvar owns int- err = s.db.QueryRow(`+ err := s.db.QueryRow(`WITH RECURSIVE ancestors AS (SELECT id, parent_id, user_idFROM nodes