mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: 移除权限节点PERM_READ_PROBLEM_DATA_SELF
This commit is contained in:
1 parent
c3b314f8dd
commit
5a7114ed8c
3 files changed
+3
-10
No files matched your search
@@ -217,8 +217,7 @@ export class ProblemDetailHandler extends ProblemHandler {
|
||||
|
||||
export class ProblemExportHandler extends ProblemDetailHandler {
|
||||
async get() {
|
||||
const hasPerm = (this.user._id === this.pdoc.owner && this.user.hasPerm(PERM.PERM_READ_PROBLEM_DATA_SELF))
|
||||
|| this.user.hasPerm(PERM.PERM_READ_PROBLEM_DATA);
|
||||
const hasPerm = this.user._id === this.pdoc.owner || this.user.hasPerm(PERM.PERM_READ_PROBLEM_DATA);
|
||||
const pdoc = pick(this.pdoc, ['pid', 'acMsg', 'content', 'config', 'title', 'html', 'tag', 'category']);
|
||||
const zip = new AdmZip();
|
||||
if (hasPerm) {
|
||||
@@ -455,7 +454,7 @@ export class ProblemFilesHandler extends ProblemDetailHandler {
|
||||
if (type === 'testdata' && !isJudge) {
|
||||
if (this.user._id !== this.pdoc.owner) {
|
||||
this.checkPerm(PERM.PERM_READ_PROBLEM_DATA);
|
||||
} else this.checkPerm(PERM.PERM_READ_PROBLEM_DATA_SELF);
|
||||
}
|
||||
}
|
||||
const links = {};
|
||||
for (const file of files) {
|
||||
|
||||
Reference in new issue
Block a user