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

Method canViewBy

packages/hydrooj/src/model/problem.ts:459–465  ·  view source on GitHub ↗
(pdoc: ProblemDoc, udoc: User)

Source from the content-addressed store, hash-verified

457 }
458
459 static canViewBy(pdoc: ProblemDoc, udoc: User) {
460 if (!udoc.hasPerm(PERM.PERM_VIEW_PROBLEM)) return false;
461 if (udoc.own(pdoc)) return true;
462 if (udoc.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN)) return true;
463 if (pdoc.hidden) return false;
464 return true;
465 }
466
467 static async import(domainId: string, filepath: string, options: ProblemImportOptions = {}) {
468 let tmpdir = '';

Callers 4

_prepareMethod · 0.80
getMethod · 0.80
onRecordChangeMethod · 0.80
prepareMethod · 0.80

Calls 2

hasPermMethod · 0.80
ownMethod · 0.80

Tested by

no test coverage detected