mirror of
https://github.com/outline/outline.git
synced 2026-12-01 17:32:49 +03:00
Authorize for collection publish
This commit is contained in:
1 parent
78e23026e6
commit
4fbb5037c5
1 file changed
+1
-1
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user