From a22ac54d9facc008ea1079ba4e402e5efc45ccf3 Mon Sep 17 00:00:00 2001 From: sohyundoh Date: Wed, 28 Aug 2024 17:24:30 +0900 Subject: [PATCH] =?UTF-8?q?#506=20[fix]=20=EB=8C=93=EA=B8=80=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C=20=EA=B6=8C=ED=95=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/mile/comment/service/CommentService.java | 4 ++-- .../com/mile/commentreply/service/CommentReplyService.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/module-domain/src/main/java/com/mile/comment/service/CommentService.java b/module-domain/src/main/java/com/mile/comment/service/CommentService.java index aaf6ddc6..ea957cb1 100644 --- a/module-domain/src/main/java/com/mile/comment/service/CommentService.java +++ b/module-domain/src/main/java/com/mile/comment/service/CommentService.java @@ -38,8 +38,8 @@ public void deleteComment( final Long userId ) { Comment comment = commentRetriever.findById(commentId); - if (commentRetriever.authenticateUserOfComment(comment, userId) && - moimRetriever.isMoimOwnerEqualsUser(comment.getWriterName().getMoim(), userId)) { + if (!commentRetriever.authenticateUserOfComment(comment, userId) && + !moimRetriever.isMoimOwnerEqualsUser(comment.getWriterName().getMoim(), userId)) { throw new ForbiddenException(ErrorMessage.COMMENT_ACCESS_ERROR); } commentReplyRemover.deleteRepliesByComment(comment); diff --git a/module-domain/src/main/java/com/mile/commentreply/service/CommentReplyService.java b/module-domain/src/main/java/com/mile/commentreply/service/CommentReplyService.java index bd1cecf8..1310845a 100644 --- a/module-domain/src/main/java/com/mile/commentreply/service/CommentReplyService.java +++ b/module-domain/src/main/java/com/mile/commentreply/service/CommentReplyService.java @@ -38,7 +38,7 @@ public void deleteCommentReply( ) { CommentReply commentReply = commentReplyRetriever.findById(replyId); if (!commentReplyRetriever.authenticateReplyWithUserId(userId, commentReply) && - moimRetriever.isMoimOwnerEqualsUser(commentReply.getWriterName().getMoim(), userId)) { + !moimRetriever.isMoimOwnerEqualsUser(commentReply.getWriterName().getMoim(), userId)) { throw new ForbiddenException(ErrorMessage.REPLY_USER_FORBIDDEN); }