mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
core: fix problem_copy testdata link
This commit is contained in:
1 parent
f2b8030bb2
commit
f9918128a9
2 files changed
+2
-1
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "3.10.4",
|
||||
"version": "3.10.5",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "src/loader",
|
||||
"module": "src/loader",
|
||||
|
||||
@@ -558,6 +558,7 @@ export class ProblemFilesHandler extends ProblemDetailHandler {
|
||||
@post('type', Types.Range(['testdata', 'additional_file']), true)
|
||||
async postGetLinks(domainId: string, files: Set<string>, type = 'testdata') {
|
||||
if (type === 'testdata' && !this.user.own(this.pdoc)) {
|
||||
if (this.pdoc.reference) throw new BadRequestError('Cannot download testdata.');
|
||||
if (!this.user.hasPriv(PRIV.PRIV_READ_PROBLEM_DATA)) this.checkPerm(PERM.PERM_READ_PROBLEM_DATA);
|
||||
if (this.tdoc && !contest.isDone(this.tdoc)) throw new ContestNotEndedError(this.tdoc.domainId, this.tdoc.docId);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user