Skip to content

Commit

Permalink
#506 [fix] 댓글 삭제 권한 수정
Browse files Browse the repository at this point in the history
#506 [fix] 댓글 삭제 권한 수정
  • Loading branch information
sohyundoh authored Aug 28, 2024
2 parents 17a2969 + a22ac54 commit d9acd4e
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 d9acd4e

Please sign in to comment.