diff --git a/src/Filament/Resources/EmailResource.php b/src/Filament/Resources/EmailResource.php index c6b5a48..5b3b9aa 100644 --- a/src/Filament/Resources/EmailResource.php +++ b/src/Filament/Resources/EmailResource.php @@ -341,8 +341,8 @@ public static function canAccess(): bool { $roles = config('filament-email.can_access.role', []); - if (method_exists(auth()->user(), 'hasRole') && ! empty($roles)) { - return auth()->user()->hasRole($roles); + if (method_exists(filament()->auth()->user(), 'hasRole') && ! empty($roles)) { + return filament()->auth()->user()->hasRole($roles); } return true;