core: fix problem_list cross-domain perm check

This commit is contained in:
undefined committed 2021-12-31 16:40:39 +08:00
1 parent 89868457d0
commit 41292624ea
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -147,7 +147,7 @@ export class ProblemModel {
const pdocs = [];
for (const id of domainIds) {
// TODO enhance performance
if (uid) {
if (typeof uid === 'number') {
// eslint-disable-next-line no-await-in-loop
const udoc = await user.getById(id, uid);
if (!udoc.hasPerm(PERM.PERM_VIEW_PROBLEM)) continue;