chore(server): revert access control in sync module (#11011)
This commit is contained in:
@@ -300,7 +300,8 @@ export class SpaceSyncGateway
|
|||||||
const adapter = this.selectAdapter(client, spaceType);
|
const adapter = this.selectAdapter(client, spaceType);
|
||||||
const id = new DocID(docId, spaceId);
|
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(
|
const timestamp = await adapter.push(
|
||||||
spaceId,
|
spaceId,
|
||||||
id.guid,
|
id.guid,
|
||||||
@@ -340,8 +341,8 @@ export class SpaceSyncGateway
|
|||||||
const { spaceType, spaceId, docId, update } = message;
|
const { spaceType, spaceId, docId, update } = message;
|
||||||
const adapter = this.selectAdapter(client, spaceType);
|
const adapter = this.selectAdapter(client, spaceType);
|
||||||
|
|
||||||
// TODO(@forehalo): change action to 'Doc.Write' after frontend supporting doc revert
|
// TODO(@forehalo): enable after frontend supporting doc revert
|
||||||
await this.ac.user(user.id).doc(spaceId, docId).assert('Doc.Read');
|
// await this.ac.user(user.id).doc(spaceId, docId).assert('Doc.Update');
|
||||||
const timestamp = await adapter.push(
|
const timestamp = await adapter.push(
|
||||||
spaceId,
|
spaceId,
|
||||||
docId,
|
docId,
|
||||||
@@ -512,8 +513,7 @@ abstract class SyncSocketAdapter {
|
|||||||
updates: Buffer[],
|
updates: Buffer[],
|
||||||
editorId: string
|
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);
|
return await this.storage.pushDocUpdates(spaceId, docId, updates, editorId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user