(pdoc: ProblemDoc, udoc: User)
| 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 = ''; |