core: script: 修复脚本回显错误的问题

This commit is contained in:
undefined committed 2021-01-22 13:41:53 +08:00
1 parent 12c43a9635
commit 6c6a0df0f0
4 files changed
+21 -16

No files matched your search

+3 -3
View File
@@ -82,14 +82,14 @@ class RecordDetailHandler extends RecordHandler {
problem.get(domainId, rdoc.pid),
user.getById(domainId, rdoc.uid),
]);
if (!(pdoc && this.user.hasPerm(PERM.PERM_VIEW_PROBLEM))) {
pdoc = problem.Pdoc.create(pdoc?.docId || 0, pdoc?.pid || '*');
}
if (!rdoc.contest && pdoc.hidden && pdoc.owner !== this.user._id) {
if (!this.user.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN)) {
pdoc = problem.Pdoc.create(pdoc.docId, pdoc.pid);
}
}
if (!this.user.hasPerm(PERM.PERM_VIEW_PROBLEM)) {
pdoc = problem.Pdoc.create(pdoc.docId, pdoc.pid);
}
this.response.body = {
path: [
['Hydro', 'homepage'],