mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: fix problem_list cross-domain perm check
This commit is contained in:
1 parent
89868457d0
commit
41292624ea
2 files changed
+2
-2
No files matched your search
@@ -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",
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in new issue
Block a user