✨Role "Commenter" on Docs

Open
#1,691 4 comments 0 reactions 1 assignee View on GitHub

@lunika is already working on this.

Since Jan 12, 2026.

Assessment

This issue has not been assessed yet.

Description

backend enhancement

Feature Request

Adding the role commenter brings some challenges because a commenter does not have the editing abilities but can create a thread and to create a thread, we need to add a "mark" on the document, meaning editing the document.

In simple:

  • commenter cannot edit
  • commenter can create a thread
  • create thread needs editing

Possible solution

Add the "mark" backend side
What Blocknote do in their REST example.

They made a setter to add a mark to a document, backend nodejs side: https://github.com/TypeCellOS/BlockNote-demo-nextjs-hocuspocus/blob/main/hocuspocus-server/src/setMark.ts

They setup a nodejs server with some routes to interact with the document backend side, the route that interest us is /:threadId/addToDocument, it is this one setting the mark:
https://github.com/TypeCellOS/BlockNote-demo-nextjs-hocuspocus/blob/main/hocuspocus-server/src/threads.ts#L85-L98
Frontend side, when they create a thread, they call addThreadToDocument: https://github.com/TypeCellOS/BlockNote/blob/main/packages/core/src/comments/extension.ts#L337-L340
It will then call this route backend side that will add the mark:
https://github.com/TypeCellOS/BlockNote/blob/main/packages/core/src/comments/threadstore/yjs/RESTYjsThreadStore.ts#L61


How can we replicate that

As Blocknote is doing we will send the necessary informations to the routes POST threads:
https://github.com/suitenumerique/docs/blob/54fe70d66244fbb35b37425736b60c8d66725da5/src/frontend/apps/impress/src/features/docs/doc-editor/components/comments/DocsThreadStore.tsx#L202-L215

If the user has the right (at least "commenter"), the backend will call the collaboration server to add a mark to the document:
https://github.com/suitenumerique/docs/blob/54fe70d66244fbb35b37425736b60c8d66725da5/src/backend/core/api/viewsets.py#L2192-L2203

To do so, we will have to implement a new route setMark as here, setMark would be expose only to the Django backend:
https://github.com/suitenumerique/docs/blob/54fe70d66244fbb35b37425736b60c8d66725da5/src/frontend/servers/y-provider/src/servers/appServer.ts#L45-L50
Thanks to the collaboration server, the mark should appear instantly to the client when it is set.

Dominant language
Python
Stars
16.8k
Forks
638
Avg merge
1d 15h
Merged PRs (30d)
40

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from suitenumerique/docs

All issues in suitenumerique/docs

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.