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
@gianmarcovarrone simple User model policy file
That will hide both the navigation and block the resource pages
No need for shield
Oh ok, that simple. So regular laravel policy
You could use #shield
if you want more specific role access
The policy works just perfect!