Shun Miyazawa 3 lat temu
rodzic
commit
2f13a762ec
1 zmienionych plików z 5 dodań i 0 usunięć
  1. 5 0
      packages/app/src/server/routes/apiv3/page.js

+ 5 - 0
packages/app/src/server/routes/apiv3/page.js

@@ -591,6 +591,11 @@ module.exports = (crowi) => {
 
       const Revision = crowi.model('Revision');
       revision = await Revision.findById(revisionIdForFind);
+
+      // Error if pageId and revison's pageIds do not match
+      if (page._id.toString() !== revision.pageId.toString()) {
+        return res.apiv3Err(new ErrorV3("Haven't the right to see the page."), 403);
+      }
     }
     catch (err) {
       logger.error('Failed to get page data', err);