mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
core: fix #1078
This commit is contained in:
3 files changed
+4
-38
No files matched your search
@@ -254,6 +254,7 @@ export class ProblemMainHandler extends Handler {
|
||||
for (const pid of pids) {
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
const pdoc = await problem.get(domainId, pid);
|
||||
if (!pdoc) throw new ProblemNotFoundError(domainId, pid);
|
||||
if (!this.user.own(pdoc, PERM.PERM_EDIT_PROBLEM_SELF)) this.checkPerm(PERM.PERM_EDIT_PROBLEM);
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
await problem.edit(domainId, pid, { hidden: true });
|
||||
@@ -266,6 +267,7 @@ export class ProblemMainHandler extends Handler {
|
||||
for (const pid of pids) {
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
const pdoc = await problem.get(domainId, pid);
|
||||
if (!pdoc) throw new ProblemNotFoundError(domainId, pid);
|
||||
if (!this.user.own(pdoc, PERM.PERM_EDIT_PROBLEM_SELF)) this.checkPerm(PERM.PERM_EDIT_PROBLEM);
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
await problem.edit(domainId, pid, { hidden: false });
|
||||
|
||||
Reference in new issue
Block a user