Skip to content

fix: carry per-user edit permission into all sidebar tree nodes - #2433

Open
shraav185 wants to merge 1 commit into
docmost:mainfrom
shraav185:fix/2357-readonly-sidebar
Open

fix: carry per-user edit permission into all sidebar tree nodes#2433
shraav185 wants to merge 1 commit into
docmost:mainfrom
shraav185:fix/2357-readonly-sidebar

Conversation

@shraav185

Copy link
Copy Markdown

Closes #2357. The sidebar tree already disables drag-and-drop for users who cannot manage pages, but three paths could still insert nodes without permission data, letting restricted/read-only pages be dragged (failing server-side with an error toast):

  • /pages/breadcrumbs now returns each ancestor's effective canEdit for the requesting user (mirroring getSidebarPages), so lazy-loaded ancestor nodes in the sidebar carry correct editability.
  • Realtime addTreeNode events backfill the receiving user's canEdit via /pages/info and remove the node entirely if the user cannot view it.
  • Optimistically created nodes are stamped with canEdit: true.

Closes docmost#2357. The sidebar tree already disables drag-and-drop for users
who cannot manage pages, but three paths could still insert nodes
without permission data, letting restricted/read-only pages be dragged
(failing server-side with an error toast):

- /pages/breadcrumbs now returns each ancestor's effective canEdit for
  the requesting user (mirroring getSidebarPages), so lazy-loaded
  ancestor nodes in the sidebar carry correct editability.
- Realtime addTreeNode events backfill the receiving user's canEdit via
  /pages/info and remove the node entirely if the user cannot view it.
- Optimistically created nodes are stamped with canEdit: true.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@CLAassistant

CLAassistant commented Aug 26, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Read only page sidebar

2 participants