samedi 1 septembre 2018

Role and permission check in laravel 5.6

I am using zizaco/entrust for managing my role and permission for the users. B Have a role permission and role_permission table. I can now assign permission in any specific role. But when I add $this->middleware(['role:superuser']); then if I logged in from another user I show 403 errors and that's fine. So I have different user with different role and *permission***. Now I want that if any user log in my system then it check his role and throws an exception if he tries to access anything that is not his permission list. So how can get the auth user role and his permission using middleware and throws or set access denied message for accessing none permit properties??



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire