core: don't check PERM_VIEW_SCOREBOARD for pretest

This commit is contained in:
undefined committed 2021-07-16 15:54:12 +08:00
1 parent af1134e05a
commit 4f9a8f1580
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "2.29.25",
"version": "2.29.26",
"bin": "bin/hydrooj.js",
"main": "dist/loader.js",
"typings": "dist/loader.d.ts",
+1 -1
View File
@@ -185,7 +185,7 @@ class RecordMainConnectionHandler extends ConnectionHandler {
if (tid) {
const tdoc = await contest.get(domainId, tid, -1);
if (!tdoc) throw new ContestNotFoundError(domainId, tid);
if (contest.canShowScoreboard.call(this, tdoc, true)) this.tid = tid.toHexString();
if (pretest || contest.canShowScoreboard.call(this, tdoc, true)) this.tid = tid.toHexString();
else throw new PermissionError(PERM.PERM_VIEW_CONTEST_HIDDEN_SCOREBOARD);
}
if (uidOrName) {