From 4fbb5037c5a6ca73d5efe10034b26bfd428b18b8 Mon Sep 17 00:00:00 2001 From: Saumya Pandey Date: Fri, 27 Aug 2021 00:25:12 +0530 Subject: [PATCH] Authorize for collection publish --- server/api/documents.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/api/documents.js b/server/api/documents.js index 635fc69528..10b45d0de6 100644 --- a/server/api/documents.js +++ b/server/api/documents.js @@ -1034,13 +1034,13 @@ router.post("documents.update", auth(), async (ctx) => { collection = await Collection.scope({ method: ["withMembership", user.id], }).findByPk(collectionId); - ctx.assertPresent(collection, "Collection should be present"); } else { collection = document.collection; } if (publish) { ctx.assertPresent(collection, "Collection should be present"); + authorize(user, "publish", collection); } const updatedDocument = await documentUpdater(