mirror of
https://github.com/alexjustesen/speedtest-tracker.git
synced 2026-06-23 07:30:09 +00:00
[Bug] Use can access method for pages (#1339)
This commit is contained in:
@@ -20,8 +20,6 @@ class Dashboard extends BasePage
|
||||
{
|
||||
protected static ?string $navigationIcon = 'heroicon-o-chart-bar';
|
||||
|
||||
protected static ?int $navigationSort = 1;
|
||||
|
||||
protected static string $view = 'filament.pages.dashboard';
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
|
||||
@@ -26,11 +26,9 @@ class GeneralPage extends SettingsPage
|
||||
|
||||
protected static string $settings = GeneralSettings::class;
|
||||
|
||||
public function mount(): void
|
||||
public static function canAccess(): bool
|
||||
{
|
||||
parent::mount();
|
||||
|
||||
abort_unless(auth()->user()->is_admin, 403);
|
||||
return auth()->user()->is_admin;
|
||||
}
|
||||
|
||||
public static function shouldRegisterNavigation(): bool
|
||||
|
||||
@@ -21,11 +21,9 @@ class InfluxDbPage extends SettingsPage
|
||||
|
||||
protected static string $settings = InfluxDbSettings::class;
|
||||
|
||||
public function mount(): void
|
||||
public static function canAccess(): bool
|
||||
{
|
||||
parent::mount();
|
||||
|
||||
abort_unless(auth()->user()->is_admin, 403);
|
||||
return auth()->user()->is_admin;
|
||||
}
|
||||
|
||||
public static function shouldRegisterNavigation(): bool
|
||||
|
||||
@@ -27,11 +27,9 @@ class NotificationPage extends SettingsPage
|
||||
|
||||
protected static string $settings = NotificationSettings::class;
|
||||
|
||||
public function mount(): void
|
||||
public static function canAccess(): bool
|
||||
{
|
||||
parent::mount();
|
||||
|
||||
abort_unless(auth()->user()->is_admin, 403);
|
||||
return auth()->user()->is_admin;
|
||||
}
|
||||
|
||||
public static function shouldRegisterNavigation(): bool
|
||||
|
||||
@@ -21,11 +21,9 @@ class ThresholdsPage extends SettingsPage
|
||||
|
||||
protected static string $settings = ThresholdSettings::class;
|
||||
|
||||
public function mount(): void
|
||||
public static function canAccess(): bool
|
||||
{
|
||||
parent::mount();
|
||||
|
||||
abort_unless(auth()->user()->is_admin, 403);
|
||||
return auth()->user()->is_admin;
|
||||
}
|
||||
|
||||
public static function shouldRegisterNavigation(): bool
|
||||
|
||||
@@ -31,8 +31,6 @@ class ResultResource extends Resource
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-table-cells';
|
||||
|
||||
protected static ?int $navigationSort = 2;
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
$settings = new GeneralSettings();
|
||||
|
||||
@@ -21,8 +21,6 @@ class UserResource extends Resource
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-users';
|
||||
|
||||
protected static ?int $navigationSort = 3;
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
|
||||
Reference in New Issue
Block a user