fix: idor checks on all exposed endpoints

This commit is contained in:
2026-03-26 02:13:01 +01:00
parent cd050f9974
commit d76e8922cc
8 changed files with 81 additions and 18 deletions

View File

@@ -1,10 +1,11 @@
// src/routes/api/matches/[id]/rolling/+server.ts
import { json, error } from '@sveltejs/kit';
import { moveToRolling } from '$lib/server/match/engine';
import { requireRole } from '$lib/server/permissions';
import type { RequestHandler } from './$types';
export const POST: RequestHandler = async ({ params, locals }) => {
if (!locals.user) error(401, 'Not logged in');
requireRole(locals, 'referee', 'Only referees or admins can move matches to rolling');
try {
const m = await moveToRolling(params.id);