diff --git a/app/Http/Livewire/News/InternArticleView.php b/app/Http/Livewire/News/InternArticleView.php index 4c09c3e1..83ce4f7e 100644 --- a/app/Http/Livewire/News/InternArticleView.php +++ b/app/Http/Livewire/News/InternArticleView.php @@ -11,6 +11,13 @@ class InternArticleView extends Component { public LibraryItem $libraryItem; + public function mount() + { + if (!$this->libraryItem->createdBy->hasRole('news-editor')) { + abort(403, 'This article is not available for viewing.'); + } + } + public function render() { return view('livewire.news.intern-article-view')->layout('layouts.app', [ diff --git a/resources/views/livewire/news/intern-article-view.blade.php b/resources/views/livewire/news/intern-article-view.blade.php index 0bb7fe67..d83000e9 100644 --- a/resources/views/livewire/news/intern-article-view.blade.php +++ b/resources/views/livewire/news/intern-article-view.blade.php @@ -1,6 +1,6 @@
-
+
@@ -9,7 +9,7 @@
-
+