changed logic in shared editor page #1514

Merged
jothi merged 1 commits from ranjith-dev into master 2026-11-25 06:33:07 +00:00

View File

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