fix: Disabling public sharing should disable all existing share links

Issue came through customer support
This commit is contained in:
Tom Moor
2020-11-30 23:39:23 -08:00
parent bde6f4b3c4
commit 1851477290
2 changed files with 28 additions and 1 deletions

View File

@ -95,6 +95,23 @@ describe("#documents.info", () => {
expect(body.data.updatedBy).toEqual(undefined);
});
it("should not return document from shareId if sharing is disabled for team", async () => {
const { document, team, user } = await seed();
const share = await buildShare({
documentId: document.id,
teamId: document.teamId,
userId: user.id,
});
team.sharing = false;
await team.save();
const res = await server.post("/api/documents.info", {
body: { shareId: share.id },
});
expect(res.status).toEqual(403);
});
it("should not return document from revoked shareId", async () => {
const { document, user } = await seed();
const share = await buildShare({