This commit is contained in:
Saeed Vaziry
2024-10-13 12:33:12 +02:00
parent 386d8e73a7
commit 224e0ac2b0
49 changed files with 3668 additions and 766 deletions

View File

@ -26,9 +26,9 @@ public function getTitle(): string|Htmlable
return $this->script->name.' - Executions';
}
public static function canAccess(): bool
public function mount(): void
{
return auth()->user()?->can('view', get_from_route(Script::class, 'script')) ?? false;
$this->authorize('view', $this->script);
}
public function getWidgets(): array

View File

@ -60,9 +60,9 @@ public function getTable(): Table
return $this->table
->heading('')
->actions([
Action::make('view')
Action::make('logs')
->hiddenLabel()
->tooltip('View')
->tooltip('Logs')
->icon('heroicon-o-eye')
->authorize(fn (ScriptExecution $record) => auth()->user()->can('view', $record->serverLog))
->modalHeading('View Log')