© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
21 replies
Abi

Show infolist conditionally based on user role

On the Admin Panel if a particular resource has an infolist instead of the View page, is there a way enable access to the infolist only for a specific user role?

Passing an empty array for an infolist doesn't help as the table rows of the resource is still clickable. Any way to disable row clicks based on user role as an alternative?
Solution
Personally instead of typing out the url, do this:
->recordUrl(fn($record) => auth()->user()->hasRole('CUSTOMER') ? null : self::getUrl('view', ['record' => $record]))
->recordUrl(fn($record) => auth()->user()->hasRole('CUSTOMER') ? null : self::getUrl('view', ['record' => $record]))
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Conditionally show widget based on record
FilamentFFilament / ❓┊help
2y ago
How to show a different Filament Panel based on the user role?
FilamentFFilament / ❓┊help
3y ago
Redirecting After Login based on user's role
FilamentFFilament / ❓┊help
10mo ago