From cb3a56705cc345f923e43fc4cbae9f6eeedef6c9 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Wed, 25 Nov 2026 12:02:30 +0530 Subject: [PATCH] changed logic in shared editor page --- app/Filament/Pages/SharedEditor.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/app/Filament/Pages/SharedEditor.php b/app/Filament/Pages/SharedEditor.php index 58210c50..35afcbb3 100644 --- a/app/Filament/Pages/SharedEditor.php +++ b/app/Filament/Pages/SharedEditor.php @@ -2,6 +2,7 @@ namespace App\Filament\Pages; +use App\Models\Configuration; use App\Models\SharedClipBoard; use Filament\Pages\Page; use Illuminate\Support\Facades\Auth; @@ -69,7 +70,24 @@ class SharedEditor extends Page public static function canAccess(): bool { - return Auth::check() && Auth::user()->can('view shared clipboard page'); + // return Auth::check() && Auth::user()->can('view shared clipboard page'); + + $user = Auth::user(); + + if(Auth::check() && !Auth::user()->can('view shared clipboard page')) + { + if (!$user) { + return false; + } + + $configuration = Configuration::where('c_group', 'Shared Clip Board')->where('c_value', $user->name)->first(); + + return $configuration ? true:false; + + } + else{ + return Auth::check() && Auth::user()->can('view shared clipboard page'); + } } }