feat: check permissions in realtime code and frontend

Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Philip Molares 2023-03-26 14:51:18 +02:00 committed by Tilman Vatteroth
parent 24f1b2a361
commit c2f41118b6
27 changed files with 287 additions and 66 deletions

View file

@ -10,9 +10,17 @@ import { YDocSyncAdapter } from './y-doc-sync-adapter.js'
export class YDocSyncServerAdapter extends YDocSyncAdapter {
constructor(
readonly messageTransporter: MessageTransporter,
readonly doc: RealtimeDoc
readonly doc: RealtimeDoc,
readonly acceptEdits: boolean
) {
super(messageTransporter, doc)
this.markAsSynced()
}
protected applyIncomingUpdatePayload(update: number[]): void {
if (!this.acceptEdits) {
return
}
super.applyIncomingUpdatePayload(update)
}
}