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'); + } } }