fix user resource
This commit is contained in:
@@ -18,6 +18,11 @@ use Filament\Tables\Table;
|
||||
|
||||
class UserResource extends Resource
|
||||
{
|
||||
public static function canAccess(): bool
|
||||
{
|
||||
return auth()->user()?->can('admin') ?? false;
|
||||
}
|
||||
|
||||
protected static ?string $model = User::class;
|
||||
|
||||
protected static string | \BackedEnum | null $navigationIcon = 'heroicon-o-users';
|
||||
@@ -57,9 +62,4 @@ class UserResource extends Resource
|
||||
'edit' => EditUser::route('/{record}/edit'),
|
||||
];
|
||||
}
|
||||
|
||||
public static function shouldRegister(): bool
|
||||
{
|
||||
return auth()->user()?->can('view_users') ?? false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user