diff --git a/.yarn/versions/f97c48cf.yml b/.yarn/versions/f97c48cf.yml new file mode 100644 index 0000000..51ebf65 --- /dev/null +++ b/.yarn/versions/f97c48cf.yml @@ -0,0 +1,2 @@ +releases: + "@aoi-js/server": 1.1.0-alpha.6 diff --git a/apps/server/src/routes/contest/solution/index.ts b/apps/server/src/routes/contest/solution/index.ts index 173a950..e1d8e39 100644 --- a/apps/server/src/routes/contest/solution/index.ts +++ b/apps/server/src/routes/contest/solution/index.ts @@ -217,7 +217,7 @@ const solutionScopedRoutes = defineRoutes(async (s) => { }) if (!solution) throw s.httpErrors.notFound() const { solutionShowOtherData } = ctx._contestStage.settings - let showData = checkUser(req, solution.userId, solutionShowOtherData) + let showData = !!solutionShowOtherData if (ctx._contest.rules?.solution) { ;({ showData } = solutionRuleEvaluator( { @@ -232,7 +232,7 @@ const solutionScopedRoutes = defineRoutes(async (s) => { { showData } )) } - if (!showData) throw s.httpErrors.forbidden() + if (!checkUser(req, solution.userId, showData)) throw s.httpErrors.forbidden() return [ctx._contest.orgId, solutionDataKey(solution._id)] }, allowedTypes: ['download']