Add permission check to delete button on EditServer (#633)

This commit is contained in:
Boy132 2024-10-18 08:24:14 +02:00 committed by GitHub
parent f357c9501f
commit ff0215afed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -753,7 +753,8 @@ class EditServer extends EditRecord
resolve(ServerDeletionService::class)->handle($server);
return redirect(ListServers::getUrl());
}),
})
->authorize(fn (Server $server) => auth()->user()->can('delete server', $server)),
Actions\Action::make('console')
->label('Console')
->icon('tabler-terminal')