From 72d56af9eb37210e6d726485be30cb8284797ca8 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Thu, 24 Apr 2025 10:27:00 +0530 Subject: [PATCH] Added view access rights --- app/Filament/Pages/Dashboard.php | 5 ++++- app/Filament/Pages/ProductionOrderCount.php | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/Filament/Pages/Dashboard.php b/app/Filament/Pages/Dashboard.php index e74e4df..14c074c 100644 --- a/app/Filament/Pages/Dashboard.php +++ b/app/Filament/Pages/Dashboard.php @@ -54,6 +54,9 @@ class Dashboard extends \Filament\Pages\Dashboard return 'Production Line Count'; } - + public static function canAccess(): bool + { + return Auth::check() && Auth::user()->can('view production line count dashboard'); + } } diff --git a/app/Filament/Pages/ProductionOrderCount.php b/app/Filament/Pages/ProductionOrderCount.php index 42217dc..80cd7ce 100644 --- a/app/Filament/Pages/ProductionOrderCount.php +++ b/app/Filament/Pages/ProductionOrderCount.php @@ -9,6 +9,7 @@ use Filament\Forms\Form; use Filament\Pages\Dashboard\Concerns\HasFiltersForm; use Filament\Pages\Page; use Filament\Tables\Concerns\HasFilters; +use Illuminate\Support\Facades\Auth; class ProductionOrderCount extends Page { @@ -84,4 +85,9 @@ class ProductionOrderCount extends Page $this->dispatch('productionOrderChart', filters: $filters); } } + + public static function canAccess(): bool + { + return Auth::check() && Auth::user()->can('view production order count dashboard'); + } }