diff --git a/app/Http/Api/Controllers/ChapterController.php b/app/Http/Api/Controllers/ChapterController.php index 1b96f7c5..dedc7caa 100644 --- a/app/Http/Api/Controllers/ChapterController.php +++ b/app/Http/Api/Controllers/ChapterController.php @@ -12,7 +12,6 @@ use App\Services\Logic\Chapter\ChapterLike as ChapterLikeService; use App\Services\Logic\Chapter\CommentList as CommentListService; use App\Services\Logic\Chapter\ConsultList as ConsultListService; use App\Services\Logic\Chapter\Learning as LearningService; -use App\Services\Logic\Chapter\ResourceList as ResourceListService; /** * @RoutePrefix("/api/chapter") @@ -44,18 +43,6 @@ class ChapterController extends Controller return $this->jsonPaginate($pager); } - /** - * @Get("/{id:[0-9]+}/resources", name="api.chapter.resourses") - */ - public function resourcesAction($id) - { - $service = new ResourceListService(); - - $resources = $service->handle($id); - - return $this->jsonSuccess(['resources' => $resources]); - } - /** * @Get("/{id:[0-9]+}/info", name="api.chapter.info") */ @@ -73,6 +60,10 @@ class ChapterController extends Controller $this->notFound(); } + if ($chapter['me']['logged'] == 0) { + $this->unauthorized(); + } + if ($chapter['me']['owned'] == 0) { $this->forbidden(); } diff --git a/app/Http/Home/Views/course/show_meta.volt b/app/Http/Home/Views/course/show_meta.volt index 13559c68..f3c018d9 100644 --- a/app/Http/Home/Views/course/show_meta.volt +++ b/app/Http/Home/Views/course/show_meta.volt @@ -92,7 +92,7 @@