From f0db5a3be524bd1018dd134ba931c982a9f0d1f5 Mon Sep 17 00:00:00 2001 From: Adam Weston Date: Wed, 13 Mar 2024 08:56:42 -0400 Subject: [PATCH] Fix: check authorization at the page level --- src/FilamentLaravelLogPlugin.php | 4 ---- src/Pages/ViewLog.php | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/FilamentLaravelLogPlugin.php b/src/FilamentLaravelLogPlugin.php index fb4b6c5..13b9021 100644 --- a/src/FilamentLaravelLogPlugin.php +++ b/src/FilamentLaravelLogPlugin.php @@ -47,10 +47,6 @@ public static function get(): static public function register(Panel $panel): void { - if (! $this->isAuthorized()) { - return; - } - $panel ->pages([ $this->viewLog, diff --git a/src/Pages/ViewLog.php b/src/Pages/ViewLog.php index f6b4310..db279a9 100644 --- a/src/Pages/ViewLog.php +++ b/src/Pages/ViewLog.php @@ -114,4 +114,9 @@ public function getTitle(): string { return __('log::filament-laravel-log.page.title'); } + + public static function canAccess(): bool + { + return FilamentLaravelLogPlugin::get()->isAuthorized(); + } }