MCPcopy Create free account
hub / github.com/hydro-dev/Hydro / prepare

Method prepare

packages/hydrooj/src/handler/training.ts:241–245  ·  view source on GitHub ↗
(domainId: string, tid: ObjectId)

Source from the content-addressed store, hash-verified

239
240 @param('tid', Types.ObjectId)
241 async prepare(domainId: string, tid: ObjectId) {
242 this.tdoc = await training.get(domainId, tid);
243 if (!this.user.own(this.tdoc)) this.checkPerm(PERM.PERM_EDIT_TRAINING);
244 else this.checkPerm(PERM.PERM_EDIT_TRAINING_SELF);
245 }
246
247 @param('tid', Types.ObjectId)
248 async get(domainId: string, tid: ObjectId) {

Callers

nothing calls this directly

Calls 3

ownMethod · 0.80
checkPermMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected