Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ class SecurityConfig(
"/application/status",
"/weekend-meal/my-status",
"/user/profile",
"/notification/**"
"/notification/**",
"/weekend-meal/period"
Comment on lines +129 to +130
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

find . -type f -name "*.kt" | xargs rg -l "weekend.*meal" | grep -v node_modules | head -20

Repository: DSM-PICK/PiCK_CORE_SERVER

Length of output: 1913


🏁 Script executed:

rg -n --type=kotlin "weekend-meal/period" --no-heading -B 5 -A 5

Repository: DSM-PICK/PiCK_CORE_SERVER

Length of output: 2475


🏁 Script executed:

find . -type f -name "*Weekend*" -o -name "*Meal*" | grep -i kotlin

Repository: DSM-PICK/PiCK_CORE_SERVER

Length of output: 5936


🏁 Script executed:

cat -n src/main/kotlin/dsm/pick2024/domain/weekendmeal/presentation/WeekendMealController.kt

Repository: DSM-PICK/PiCK_CORE_SERVER

Length of output: 5360


🏁 Script executed:

rg -n --type=kotlin "@PatchMapping|@PostMapping|@GetMapping" src/main/kotlin/dsm/pick2024/domain/weekendmeal/presentation/WeekendMealController.kt -A 3

Repository: DSM-PICK/PiCK_CORE_SERVER

Length of output: 1953


🏁 Script executed:

cat -n src/main/kotlin/dsm/pick2024/domain/weekendmeal/presentation/dto/request/SettingWeekendMealPeriodRequest.kt

Repository: DSM-PICK/PiCK_CORE_SERVER

Length of output: 541


🏁 Script executed:

cat -n src/main/kotlin/dsm/pick2024/domain/weekendmeal/service/SettingWeekendMealPeriodService.kt | head -50

Repository: DSM-PICK/PiCK_CORE_SERVER

Length of output: 1803


Remove "/weekend-meal/period" from ROLE_STU PATCH permissions — this is an admin-only endpoint.

The endpoint modifies the weekend meal application period (start/end dates), which is a system-level setting for administrators. The service code at line 18 calls adminFacadeUseCase.currentAdmin(), confirming it expects an admin user. Granting ROLE_STU access violates authorization requirements and will cause runtime failures when students attempt to access it. This endpoint should remain restricted to ROLE_SCH only.

🤖 Prompt for AI Agents
In src/main/kotlin/dsm/pick2024/global/config/security/SecurityConfig.kt around
lines 129-130, remove the "/weekend-meal/period" entry from the PATCH
permissions granted to ROLE_STU so that students no longer have access; ensure
the path remains only in the admin/ROLE_SCH-only rules (or the admin antMatcher)
so that only administrators can PATCH this endpoint, and adjust the
corresponding authorizeRequests/antMatchers block accordingly.

).hasRole(Role.STU.name)
.antMatchers(
HttpMethod.PATCH,
Expand Down