File tree Expand file tree Collapse file tree
src/main/java/org/runnect/server/publicCourse/service Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4848public class PublicCourseService {
4949 private static final Integer PAGE_SIZE = 10 ;
5050 private static List <Long > MARATHON_PUBLIC_COURSE_IDS ;
51+ private static final Long ADMIN_USER_ID = 280L ;
5152
5253 private final PublicCourseRepository publicCourseRepository ;
5354 private final UserRepository userRepository ;
@@ -350,8 +351,10 @@ public DeletePublicCoursesResponseDto deletePublicCourses(
350351 throw new NotFoundException (ErrorStatus .NOT_FOUND_PUBLICCOURSE_EXCEPTION , ErrorStatus .NOT_FOUND_PUBLICCOURSE_EXCEPTION .getMessage ());
351352 }
352353
354+ boolean isAdmin = userId .equals (ADMIN_USER_ID );
355+
353356 publicCourses .stream ()
354- .filter (pc -> !pc .getCourse ().getRunnectUser ().equals (user ))
357+ .filter (pc -> !isAdmin && ! pc .getCourse ().getRunnectUser ().equals (user ))
355358 .findAny ()
356359 .ifPresent (pc -> {
357360 throw new PermissionDeniedException (
You can’t perform that action at this time.
0 commit comments