From e963c708543048087d581dffb6118277b1a8de05 Mon Sep 17 00:00:00 2001 From: Benjamin Takats Date: Fri, 27 Jan 2023 15:44:20 +0100 Subject: [PATCH] back buttons --- app/Http/Livewire/News/InternArticleView.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/Http/Livewire/News/InternArticleView.php b/app/Http/Livewire/News/InternArticleView.php index a5a95c6b..79e1c168 100644 --- a/app/Http/Livewire/News/InternArticleView.php +++ b/app/Http/Livewire/News/InternArticleView.php @@ -11,6 +11,17 @@ class InternArticleView extends Component { public LibraryItem $libraryItem; + public function mount() + { + $this->libraryItem->load([ + 'libraries', + ]); + if ($this->libraryItem->libraries->where('is_public', false) + ->count() > 0) { + abort(403, __('Sorry! You are not authorized to perform this action.')); + } + } + public function render() { if ($this->libraryItem->type === 'markdown_article') {