Authorize for collection publish

This commit is contained in:
Saumya Pandey committed 2021-08-27 00:25:12 +05:30
1 parent 78e23026e6
commit 4fbb5037c5
1 file changed
+1 -1
+1 -1
View File
@@ -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(