core: handle 2FA permission check

This commit is contained in:
undefined committed 2022-10-18 19:38:23 +08:00
1 parent f68b8d54cf
commit 502ced8f27
4 files changed
+6 -1

No files matched your search

+1
View File
@@ -44,6 +44,7 @@ registerValue('Contest', [
registerResolver(
'Query', 'contest(id: ObjectID!)', 'Contest',
async (arg, ctx) => {
ctx.checkPerm(PERM.PERM_VIEW);
arg.id = new ObjectID(arg.id);
ctx.tdoc = await contest.get(ctx.args.domainId, new ObjectID(arg.id));
if (!ctx.tdoc) throw new ContestNotFoundError(ctx.args.domainId, arg.id);