소스 검색

check author

itizawa 6 년 전
부모
커밋
b857206dfe
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      src/server/routes/comment.js

+ 4 - 0
src/server/routes/comment.js

@@ -171,6 +171,10 @@ module.exports = function(crowi, app) {
       return res.json(ApiResponse.error('\'comment_id\' is undefined'));
     }
 
+    if (creatorId !== req.user.id) {
+      return res.json(ApiResponse.error('Only the creator can edit'));
+    }
+
     // check whether accessible
     const isAccessible = await Page.isAccessiblePageByViewer(pageId, req.user._id, revisionId, comment, isMarkdown, req.user);
     if (!isAccessible) {