Browse Source

Fix can't see submission after contest

pull/6/head
Menci 7 years ago
parent
commit
c9cd84c54c
  1. 7
      models/judge_state.js

7
models/judge_state.js

@ -105,7 +105,12 @@ class JudgeState extends Model {
if (user && user.id === this.problem.user_id) return true;
else if (this.type === 0 || this.type == 2) return this.problem.is_public || (user && (await user.hasPrivilege('manage_problem')));
else if (this.type === 1) {
return user && (user.is_admin || user.id === this.user_id);
let contest = await Contest.fromID(this.type_info);
if (await contest.isRunning()) {
return (user && this.user_id === user.id) || (user && user.is_admin);
} else {
return true;
}
}
}

Loading…
Cancel
Save