diff --git a/modules/contest.js b/modules/contest.js index f1b4a54..8562f31 100644 --- a/modules/contest.js +++ b/modules/contest.js @@ -234,7 +234,7 @@ app.get('/contest/:id/ranklist', async (req, res) => { if (!contest) throw new ErrorMessage('无此比赛。'); if ([contest.allowedSeeingResult() && contest.allowedSeeingOthers(), contest.isEnded(), - contest.isSupervisior(curUser)].every(x => !x)) + await contest.isSupervisior(curUser)].every(x => !x)) throw new ErrorMessage('您没有权限进行此操作。'); await contest.loadRelationships(); diff --git a/modules/submission.js b/modules/submission.js index 30f7b7f..5c0b9a8 100644 --- a/modules/submission.js +++ b/modules/submission.js @@ -54,7 +54,7 @@ app.get('/submissions', async (req, res) => { const contest = await Contest.fromID(contestId); contest.ended = contest.isEnded(); if (contest.ended || // If the contest is ended - (curUser && contest.isSupervisior(curUser)) // Or if the user have the permission to check + (curUser && await contest.isSupervisior(curUser)) // Or if the user have the permission to check ) { where.type = { $eq: 1 }; where.type_info = { $eq: contestId };