Skip to content

Commit

Permalink
#506 [fix] 댓글 삭제 권한 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
sohyundoh committed Aug 28, 2024
2 parents fb10a56 + d9acd4e commit 07ed71e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 07ed71e

Please sign in to comment.