share / sharedb

Realtime database backend based on Operational Transformation (OT)
Other
6.1k stars 444 forks source link

Access Control / Permissions #642

Open MentalGear opened 4 months ago

MentalGear commented 4 months ago

A very fine project! I'm new to OT/CRDT, and I was wondering how/if a (central) user/role/group permission based access control can be added?

For example, for a Notes PoC. Also, how would conflicts like these be handled?

alecgibson commented 4 months ago

You would just return a sensible error code to Member D and handle that client-side (show some alert for example), just as with a traditional HTTP API.

curran commented 4 months ago

If you put access control rules in the middleware on the server, the changes from Member D will be sent to the server but not actually ever applied to the document.

See the docs here: https://share.github.io/sharedb/middleware/op-submission#apply