core: fix problem_copy testdata link

This commit is contained in:
undefined committed 2022-03-23 23:36:26 +08:00
1 parent f2b8030bb2
commit f9918128a9
2 files changed
+2 -1

No files matched your search

+1
View File
@@ -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);
}