feat: Always show share button (#2469)

This is to enable the share page also for internal team members.

closes #2444
This commit is contained in:
Wesley
2021-08-23 08:20:29 +02:00
committed by GitHub
parent d8ad2fc1a2
commit a50471959b
4 changed files with 48 additions and 10 deletions

View File

@ -235,6 +235,27 @@ describe("#documents.info", () => {
expect(res.status).toEqual(403);
});
it("should return document from shareId if public sharing is disabled but the user has permission to read", async () => {
const { document, collection, team, user } = await seed();
const share = await buildShare({
documentId: document.id,
teamId: document.teamId,
userId: user.id,
});
team.sharing = false;
await team.save();
collection.sharing = false;
await collection.save();
const res = await server.post("/api/documents.info", {
body: { token: user.getJwtToken(), shareId: share.id },
});
expect(res.status).toEqual(200);
});
it("should not return document from revoked shareId", async () => {
const { document, user } = await seed();
const share = await buildShare({