fix(social): 댓글·좋아요 접근 제어, 신고 API 접근 제어에 오늘 공유 조건 추가#173
Merged
Conversation
기존 access check가 isShared=true만 검사해 친구가 어제 공유 후 끄지 않은 리포트는 dailyReportId 추측만으로 댓글·좋아요 진입이 가능하던 문제 해결, existsByIdAndIsSharedTrue → existsByIdAndIsSharedTrueAndDate 변경하고 메서드 쓰인 곳 모두 변경
ContentReportCommandService.checkReportAccess 메서드로 본인 글 early return, 그 외 오늘 공유된 친구 리포트만 신고 가능 권한 체크, 비밀 댓글 신고 시 추가 권한 체크, Swagger 403 응답 명세 추가
Collaborator
|
머지 고고 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 요약(Summary)
문제
구현
existsByIdAndIsSharedTrue → existsByIdAndIsSharedTrueAndDate 변경
호출처 5곳에 today 조건 적용:
· CommentQueryService.checkCommentViewAccess
· CommentCommandService.checkCommentWriteAccess
· LikeQueryService.checkCommentViewAccess
· LikeCommandService.checkReportLikeAccess, checkCommentLikeAccess
본인 리포트는 early return 유지 — 본인의 과거·비공유 글 댓글창 접근 보장
ContentReportCommandService.checkReportAccess 헬퍼 신설: 본인 글 early return, 그 외 오늘 공유된 친구 리포트만 신고 가능
비밀 댓글 신고 시 추가 권한 체크 (리포트 소유자 또는 부모 댓글 작성자만 가능)
· 자기 신고 방지가 위에서 작성자 본인을 차단하므로 실질 권한자는 owner·parentAuthor
ModerationController Swagger 403 응답 명세 추가
🔗 Related Issue
💬 공유사항
✅ PR Checklist
PR이 다음 요구 사항을 충족하는지 확인하세요.