core: fix contest permission check

pull/328/head
undefined 3 years ago
parent 040205045f
commit 4f46305d21

@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "3.10.6",
"version": "3.10.7",
"bin": "bin/hydrooj.js",
"main": "src/loader",
"module": "src/loader",

@ -239,7 +239,8 @@ class RecordMainConnectionHandler extends ConnectionHandler {
if (!this.pretest && rdoc.input) return;
if (rdoc.domainId !== this.domainId) return;
if (rdoc.contest && ![this.tid, '000000000000000000000000'].includes(rdoc.contest.toString())) return;
if (this.tid && contest.isLocked(this.tdoc) && !contest.canShowScoreboard.call(this, this.tdoc, true)) return;
if (this.tid && contest.isLocked(this.tdoc)) return;
if (this.tid && !contest.canShowSelfRecord.call(this, this.tdoc, true)) return;
}
if (this.pid && rdoc.pid !== this.pid) return;
if (this.uid && rdoc.uid !== this.uid) return;

Loading…
Cancel
Save