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
@@ -1,6 +1,6 @@
{ {
"name": "hydrooj", "name": "hydrooj",
"version": "3.2.37", "version": "3.2.38",
"bin": "bin/hydrooj.js", "bin": "bin/hydrooj.js",
"main": "src/loader", "main": "src/loader",
"module": "src/loader", "module": "src/loader",
+1 -1
View File
@@ -147,7 +147,7 @@ export class ProblemModel {
const pdocs = []; const pdocs = [];
for (const id of domainIds) { for (const id of domainIds) {
// TODO enhance performance // TODO enhance performance
if (uid) { if (typeof uid === 'number') {
// eslint-disable-next-line no-await-in-loop // eslint-disable-next-line no-await-in-loop
const udoc = await user.getById(id, uid); const udoc = await user.getById(id, uid);
if (!udoc.hasPerm(PERM.PERM_VIEW_PROBLEM)) continue; if (!udoc.hasPerm(PERM.PERM_VIEW_PROBLEM)) continue;