Skip to content

πŸ“š The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.

Fix permissions system

Smaug6739553f7b946761
diff --git a/backend/controllers/nodes.controller.go b/backend/controllers/nodes.controller.go
index 284cc41b..9350f5db 100644
--- a/backend/controllers/nodes.controller.go
+++ b/backend/controllers/nodes.controller.go
@@ -228,7 +228,7 @@ func (ctr *Controller) UpdateNode(c *gin.Context) (int, any) {
allowed, level, err := ctr.authorizer.CanAccessNode(connectedUserId, connectedUserRole, dbNode, permissions.ActionUpdate)
- // Special case: The document is public (accessibility = 3) and access < 2 (write or admin)
+ // Special case: The document is public (accessibility = 3) and access < 2 (user is viewer or none)
if !allowed && (dbNode.Access < 2 || *dbNode.Accessibility != 3) {
return http.StatusUnauthorized, err
}
diff --git a/frontend/app/components/Node/NodePermissions.modal.vue b/frontend/app/components/Node/NodePermissions.modal.vue
index 8320395c..180d9bc2 100644
--- a/frontend/app/components/Node/NodePermissions.modal.vue
+++ b/frontend/app/components/Node/NodePermissions.modal.vue
@@ -113,8 +113,9 @@ const searchUsers = debounce((query: unknown) => {
}, 750);
watch(
- node.value,
+ node,
debounce(() => nodesStore.update(node.value), 500),
+ { deep: true },
);
const addPermission = async (user: PublicUser) => {
if (!user) return;