mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
core: also hide hidden problem when search
This commit is contained in:
1 parent
1c26f25654
commit
71a5f6dd13
2 files changed
+7
-1
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "3.1.46",
|
||||
"version": "3.1.47",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "src/loader",
|
||||
"module": "src/loader",
|
||||
|
||||
@@ -161,6 +161,12 @@ export class ProblemMainHandler extends ProblemHandler {
|
||||
pdocs.unshift(pdoc);
|
||||
pcount = pcount - count + pdocs.length;
|
||||
}
|
||||
const canViewHidden = this.user.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN);
|
||||
if (!canViewHidden) {
|
||||
const unshift = [];
|
||||
for (const doc of pdocs) if (doc.hidden && !this.user.own(doc)) unshift.push(doc);
|
||||
for (const task of unshift) pdocs.unshift(task);
|
||||
}
|
||||
}
|
||||
if (this.user.hasPriv(PRIV.PRIV_USER_PROFILE)) {
|
||||
psdict = await problem.getListStatus(
|
||||
|
||||
Reference in new issue
Block a user