mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: pass pdoc with UiContext
This commit is contained in:
1 parent
ec83da1080
commit
19e14fc90f
7 files changed
+23
-26
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "2.26.6",
|
||||
"version": "2.26.7",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "dist/loader.js",
|
||||
"typings": "dist/loader.d.ts",
|
||||
|
||||
@@ -381,10 +381,7 @@ export class ProblemFilesHandler extends ProblemDetailHandler {
|
||||
@param('additional_file', Types.Boolean)
|
||||
@param('pjax', Types.Boolean)
|
||||
async get(domainId: string, getTestdata = true, getAdditionalFile = true, pjax = false) {
|
||||
const canReadData = this.user.own(this.pdoc)
|
||||
|| this.user.hasPriv(PRIV.PRIV_READ_PROBLEM_DATA)
|
||||
|| this.user.hasPerm(PERM.PERM_READ_PROBLEM_DATA);
|
||||
this.response.body.testdata = (getTestdata && canReadData) ? sortFiles(this.pdoc.data || []) : [];
|
||||
this.response.body.testdata = getTestdata ? sortFiles(this.pdoc.data || []) : [];
|
||||
this.response.body.additional_file = getAdditionalFile ? sortFiles(this.pdoc.additional_file || []) : [];
|
||||
if (pjax) {
|
||||
const { testdata, additional_file } = this.response.body;
|
||||
|
||||
Reference in new issue
Block a user