-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEAT] 응원톡 관리 화면에서의 응원톡 전체 조회 #232
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
6b1aa3d
[REFACTOR] CheerTalkResponse.Reported 를 CheerTalkResponse.ForManager …
Jin409 0ea33a3
[FIX] 게임팀의 아이디로 응원톡을 조회하는 쿼리로 변경 #218
Jin409 65b2e18
[FEAT] 리그에 해당하는 응원톡 전체 조회 #218
Jin409 db07b70
[ADD] SecurityConfig 에 엔드포인트 추가 #218
Jin409 3f8baaf
[FIX] 차단되지 않은 응원톡만 조회하도록 조건 추가 #218
Jin409 131a077
[TEST] 서비스 테스트 추가 #218
Jin409 9a436f8
[TEST] 인수 테스트 추가 #218
Jin409 bea8d9d
Merge branch 'main' of https://github.com/hufscheer/spectator-server …
Jin409 ea5cc5e
[DOCS] 문서화 추가 #218
Jin409 8dff26b
[TEST] 랜덤으로 이름의 길이가 지정되어 테스트가 실패하는 오류 수정 #218
Jin409 3122135
[ADD] 권한 검사가 필요한 엔티티를 추상화하기 위해 ManagedEntity 인터페이스 추가 #218
Jin409 747f12c
[FEAT] 권한 검사 기능 구현 #218
Jin409 d1a27e0
[REFACTOR] 중복된 코드 제거 및 PermissionValidator 를 사용하도록 수정 #218
Jin409 e709e98
[MERGE] 메인 브랜치 변경사항 반영 #218
Jin409 256769b
[REFACTOR] PermissionValidator 가 권한 검사만 담당하도록 수정 #218
Jin409 22c7985
[MERGE] 메인 브랜치 변경사항 반영 #218
Jin409 c4b5c06
[DOCS] 문서화 반영 #218
Jin409 05f0ef5
[REFACTOR] PermissionValidator 를 빈으로 등록하지 않고 정적메서드로 선언 #218
Jin409 3b302a4
[REFACTOR] PermissionValidator 를 빈으로 등록하지 않고 정적메서드로 선언 #218
Jin409 47cfc96
[REFACTOR] 에러 메시지 자세하게 수정 #218
Jin409 6444400
[FIX] 사용되지 않는 의존성 주입 삭제 #218
Jin409 fd4fc3e
[TEST] 에러 메시지 수정에 따른 메시지 검증 로직 삭제 #218
Jin409 f156935
[MERGE] 메인 브랜치 변경 사항 반영 #218
Jin409 a50e24c
[TEST] 에러 메시지 검증 삭제 #218
Jin409 d23a876
[DOCS] 문서화 #218
Jin409 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
15 changes: 15 additions & 0 deletions
15
src/main/java/com/sports/server/common/application/PermissionValidator.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.sports.server.common.application; | ||
|
||
import com.sports.server.command.member.domain.Member; | ||
import com.sports.server.common.domain.ManagedEntity; | ||
import com.sports.server.common.exception.UnauthorizedException; | ||
|
||
public class PermissionValidator { | ||
|
||
public static <T extends ManagedEntity> void checkPermission(final T entity, final Member manager) { | ||
if (!entity.isManagedBy(manager)) { | ||
throw new UnauthorizedException( | ||
manager.getEmail() + " 은 " + entity.getClass() + " 에 접근할 권한이 존재하지 않습니다."); | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/com/sports/server/common/domain/ManagedEntity.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.sports.server.common.domain; | ||
|
||
import com.sports.server.command.member.domain.Member; | ||
|
||
public interface ManagedEntity { | ||
boolean isManagedBy(Member manager); | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
코드 내용과는 별개로... Collection.forEach와 Stream.forEach의 차이