Add role permission for health page (#878)

This commit is contained in:
Boy132 2025-01-06 15:43:29 +01:00 committed by GitHub
parent 7f37b3b099
commit 448fe41e78
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 1 deletions

View File

@ -23,6 +23,11 @@ class Health extends Page
'refresh-component' => '$refresh', 'refresh-component' => '$refresh',
]; ];
public static function canAccess(): bool
{
return auth()->user()->can('view health');
}
protected function getActions(): array protected function getActions(): array
{ {
return [ return [

View File

@ -97,7 +97,7 @@ class RoleResource extends Resource
$icon = ('\App\Filament\Server\Resources\\' . $model . 'Resource')::getNavigationIcon(); $icon = ('\App\Filament\Server\Resources\\' . $model . 'Resource')::getNavigationIcon();
} }
return Section::make(Str::headline(Str::plural($model))) return Section::make(Str::headline($model))
->columnSpan(1) ->columnSpan(1)
->collapsible() ->collapsible()
->collapsed() ->collapsed()

View File

@ -33,6 +33,9 @@ class Role extends BaseRole
'view', 'view',
'update', 'update',
], ],
'health' => [
'view',
],
'activity' => [ 'activity' => [
'seeIps', 'seeIps',
], ],