Skip to content

Commit

Permalink
refactor: 현재 사용자가 행사 등록자가 아닐 때 403 에러 리턴
Browse files Browse the repository at this point in the history
  • Loading branch information
xyzwv committed Nov 23, 2023
1 parent 944aca5 commit 6a53e05
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
import java.util.List;
import java.util.stream.Collectors;

import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.server.ResponseStatusException;

import com.efub.dhs.domain.member.entity.Member;
import com.efub.dhs.domain.member.service.MemberService;
Expand Down Expand Up @@ -40,7 +42,7 @@ public List<RegistrationResponseDto> findRegistratorList(Program program) {
List<Registration> registrationList = registrationRepository.findAllByProgram(program);
return registrationList.stream().map(RegistrationResponseDto::from).collect(Collectors.toList());
} else {
throw new SecurityException("접근 권한이 없습니다.");
throw new ResponseStatusException(HttpStatus.FORBIDDEN);
}
}
}

0 comments on commit 6a53e05

Please sign in to comment.