Prevent user from viewing a resource

Hello, I would like to prevent users, based on their role, to access specific resources (Example: If user isn't admin he can't see the user resources at all). I was able to conditionally hide the navigation label, but of course the url is still accessible.
4 Replies
Mark Chaney
Mark Chaney2y ago
@gianmarcovarrone simple User model policy file That will hide both the navigation and block the resource pages No need for shield
Gianmarco Varrone
Oh ok, that simple. So regular laravel policy
RickDB
RickDB2y ago
You could use #shield if you want more specific role access
Gianmarco Varrone
The policy works just perfect!
Want results from more Discord servers?
Add your server