3232@ RequiredArgsConstructor
3333public class RecruitCoreAdminController {
3434
35- private static final String ORGANIZER_OR_HR_LEAD_RULE =
35+ private static final String LEAD_OR_HIGHER_RULE =
3636 "@accessGuard.check(authentication,"
3737 + " T(inha.gdgoc.global.security.AccessGuard$AccessCondition).atLeast("
38- + "T(inha.gdgoc.domain.user.enums.UserRole).ORGANIZER),"
39- + " T(inha.gdgoc.global.security.AccessGuard$AccessCondition).of("
40- + "T(inha.gdgoc.domain.user.enums.UserRole).LEAD,"
41- + " T(inha.gdgoc.domain.user.enums.TeamType).HR))" ;
38+ + "T(inha.gdgoc.domain.user.enums.UserRole).LEAD))" ;
4239
4340 private final RecruitCoreAdminService adminService ;
4441
45- @ PreAuthorize ("hasAnyRole('ADMIN','ORGANIZER')" )
42+ @ PreAuthorize (LEAD_OR_HIGHER_RULE )
4643 @ GetMapping
4744 public RecruitCoreApplicationPageResponse list (
4845 @ RequestParam String session ,
@@ -66,13 +63,13 @@ public RecruitCoreApplicationPageResponse list(
6663 );
6764 }
6865
69- @ PreAuthorize (ORGANIZER_OR_HR_LEAD_RULE )
66+ @ PreAuthorize (LEAD_OR_HIGHER_RULE )
7067 @ GetMapping ("/{applicationId}" )
7168 public ResponseEntity <RecruitCoreApplicantDetailResponse > detail (@ PathVariable Long applicationId ) {
7269 return ResponseEntity .ok (adminService .getApplicationDetail (applicationId ));
7370 }
7471
75- @ PreAuthorize (ORGANIZER_OR_HR_LEAD_RULE )
72+ @ PreAuthorize (LEAD_OR_HIGHER_RULE )
7673 @ PostMapping ("/{applicationId}/accept" )
7774 public ResponseEntity <RecruitCoreApplicationDecisionResponse > accept (
7875 @ AuthenticationPrincipal CustomUserDetails reviewer ,
@@ -84,7 +81,7 @@ public ResponseEntity<RecruitCoreApplicationDecisionResponse> accept(
8481 return ResponseEntity .ok (response );
8582 }
8683
87- @ PreAuthorize (ORGANIZER_OR_HR_LEAD_RULE )
84+ @ PreAuthorize (LEAD_OR_HIGHER_RULE )
8885 @ PostMapping ("/{applicationId}/reject" )
8986 public ResponseEntity <RecruitCoreApplicationDecisionResponse > reject (
9087 @ AuthenticationPrincipal CustomUserDetails reviewer ,
0 commit comments