mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: limit access for hidden problems' submission
This commit is contained in:
1 parent
77fc46c069
commit
738d622225
14 files changed
+52
-53
No files matched your search
@@ -388,8 +388,8 @@ export class ContestCodeHandler extends Handler {
|
||||
async get(domainId: string, tid: ObjectID) {
|
||||
await this.limitRate('contest_code', 3600, 60);
|
||||
const [tdoc, tsdocs] = await contest.getAndListStatus(domainId, tid);
|
||||
if (!this.user.own(tdoc) && !this.user.hasPriv(PRIV.PRIV_READ_RECORD)) {
|
||||
this.checkPerm(PERM.PERM_READ_RECORD);
|
||||
if (!this.user.own(tdoc) && !this.user.hasPriv(PRIV.PRIV_READ_RECORD_CODE)) {
|
||||
this.checkPerm(PERM.PERM_READ_RECORD_CODE);
|
||||
}
|
||||
if (!contest.canShowRecord.call(this, tdoc as any, true)) {
|
||||
throw new PermissionError(PERM.PERM_VIEW_CONTEST_HIDDEN_SCOREBOARD);
|
||||
|
||||
Reference in new issue
Block a user