Skip to content
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

[#33] 게시글 권한관리 추가 #38

Merged
merged 4 commits into from
Jul 1, 2024
Merged

[#33] 게시글 권한관리 추가 #38

merged 4 commits into from
Jul 1, 2024

Conversation

hyeok-kong
Copy link
Collaborator

@hyeok-kong hyeok-kong commented Jun 23, 2024

구현 기능

  • 게시글 등록, 삭제 메소드에 인가 추가
  • AOP를 통해 구현

개발 코멘트

1. AOP를 통한 인가 구현

인가를 구현하며 선택에 대한 고민을 했습니다.
Spring Security 도입, 책임 연쇄 패턴 적용 등을 고민했지만 현재 수준에선 필요가 없다고 느꼈으며, AOP를 통해 구현하였습니다.
추후, 보다 복잡한 인가 로직이 요구될 때 위에서 언급한 방법들의 도입을 고려할 예정입니다.

2. AOP 구현 방식

AOP 구현에 다음 방식들을 고려했습니다.

  1. 메소드 매개 변수의 순서를 맞추어 적용

@around("@annotation(CheckGroupMember) && args(userId, groupId, ..)")

위와 같은 방법을 사용할 시, 기존의 메소드들, 추후 개발될 메소드들을 모두 매개 변수 순서를 맞춰주어야 합니다.

  1. 파라미터 어노테이션 적용
    현재 적용한 방법입니다. 여전히 매개 변수를 강제하진 않지만, 위 방법보다 유연한 메소드 시그니처를 지원합니다.

@hyeok-kong hyeok-kong added the enhancement New feature or request label Jun 23, 2024
@hyeok-kong hyeok-kong self-assigned this Jun 23, 2024
@hyeok-kong hyeok-kong merged commit 45cd524 into main Jul 1, 2024
1 check passed
@hyeok-kong hyeok-kong linked an issue Jul 1, 2024 that may be closed by this pull request
3 tasks
@hyeok-kong hyeok-kong deleted the feature/33 branch July 1, 2024 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

게시판 기능 구현
2 participants