public function actionDefault($id) { $solution = $this->solutionRepository->find($id); $this->setupCourseRegistry($solution); if (!$this->courseRegistry->unit->hasReviewsPhaseStarted() && !$this->user->isAllowed('solution', 'viewAnytime')) { throw new \Nette\Application\BadRequestException('Forbidden', 403); } if ($this->user->isAllowed('solution', 'viewLog')) { $this->template->solutionLog = $this->logRepository->findByEntity('Solution', $id); } }