Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

chore(server): revert access control in sync module (#11011)

forehalo33d57b455a0c
diff --git a/packages/backend/server/src/core/sync/gateway.ts b/packages/backend/server/src/core/sync/gateway.ts
index a6d9c52600..b99b601ae7 100644
--- a/packages/backend/server/src/core/sync/gateway.ts
+++ b/packages/backend/server/src/core/sync/gateway.ts
@@ -300,7 +300,8 @@ export class SpaceSyncGateway
const adapter = this.selectAdapter(client, spaceType);
const id = new DocID(docId, spaceId);
- await this.ac.user(user.id).doc(spaceId, id.guid).assert('Doc.Update');
+ // TODO(@forehalo): enable after frontend supporting doc revert
+ // await this.ac.user(user.id).doc(spaceId, id.guid).assert('Doc.Update');
const timestamp = await adapter.push(
spaceId,
id.guid,
@@ -340,8 +341,8 @@ export class SpaceSyncGateway
const { spaceType, spaceId, docId, update } = message;
const adapter = this.selectAdapter(client, spaceType);
- // TODO(@forehalo): change action to 'Doc.Write' after frontend supporting doc revert
- await this.ac.user(user.id).doc(spaceId, docId).assert('Doc.Read');
+ // TODO(@forehalo): enable after frontend supporting doc revert
+ // await this.ac.user(user.id).doc(spaceId, docId).assert('Doc.Update');
const timestamp = await adapter.push(
spaceId,
docId,
@@ -512,8 +513,7 @@ abstract class SyncSocketAdapter {
updates: Buffer[],
editorId: string
) {
- // TODO(@forehalo): enable this after 0.19 goes out of life
- // this.assertIn(spaceId);
+ this.assertIn(spaceId);
return await this.storage.pushDocUpdates(spaceId, docId, updates, editorId);
}