Skip to content

Commit

Permalink
refactor: 게시판 카테고리 재분류 완료 (#608)
Browse files Browse the repository at this point in the history
  • Loading branch information
mingmingmon authored Nov 6, 2024
1 parent 58572a7 commit 6c96deb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ public boolean isNotice() {
return this.category.equals(BoardCategory.NOTICE);
}

public boolean isGraduated() {
return this.category.equals(BoardCategory.GRADUATED);
}

public boolean shouldNotifyForNewBoard(MemberDetailedInfoDto memberInfo) {
return memberInfo.isAdminRole() && this.category.equals(BoardCategory.NOTICE); // Assuming 2 is Admin role level
}
Expand All @@ -72,8 +68,5 @@ public void validateAccessPermissionForCreation(MemberDetailedInfoDto currentMem
if (this.isNotice() && !currentMemberInfo.isAdminRole()) {
throw new PermissionDeniedException("공지사항은 관리자만 작성할 수 있습니다.");
}
if (this.isGraduated() && !currentMemberInfo.isGraduated()) {
throw new PermissionDeniedException("졸업생 게시판은 졸업생만 작성할 수 있습니다.");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ public enum BoardCategory {

NOTICE("notice", "공지사항"),
FREE("free", "자유 게시판"),
QNA("qna", "질문 게시판"),
GRADUATED("graduated", "졸업생 게시판"),
DEVELOPMENT_QNA("development_qna", "개발 질문 게시판"),
INFORMATION_REVIEWS("information_reviews", "정보 및 후기 게시판"),
ORGANIZATION("organization", "동아리 소식");

private final String key;
Expand Down

0 comments on commit 6c96deb

Please sign in to comment.