How to use authorization with actions in table

I am trying to use authorization with an action in my table but I have no idea how this should work.
Tables\Actions\Action::make(__('Download'))
->url(fn ($record) => route('filament.app.resources.qr-codes.download', $record->id))
->authorize('view', $this->record),
Tables\Actions\Action::make(__('Download'))
->url(fn ($record) => route('filament.app.resources.qr-codes.download', $record->id))
->authorize('view', $this->record),
The problem is I can't access the record
2 Replies
Dennis Koch
Dennis Koch2mo ago
The problem is I can't access the record
The URL you are calling? The authorize method handles auth for that button/action. Not for urls you call/redirect to
TheNastyPasty
TheNastyPasty2mo ago
Thanks