From 383965b410fc43ac2f335420195911afdbb0eb8e Mon Sep 17 00:00:00 2001 From: Menci Date: Wed, 14 Dec 2016 18:36:23 +0800 Subject: [PATCH] Disallow users to see non-public problem's judge state --- models/judge_state.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/judge_state.js b/models/judge_state.js index 1cd2102..58c41a3 100644 --- a/models/judge_state.js +++ b/models/judge_state.js @@ -122,7 +122,7 @@ class JudgeState extends Model { await this.loadRelationships(); if (user && (user.is_admin || user.id === this.problem.user_id)) return true; - else if (this.type === 0) return true; + else if (this.type === 0) return this.problem.public; else if (this.type === 1) { let contest = await Contest.fromID(this.type_info); if (await contest.isRunning()) {