two different panel with roles
Hi any option to do this?
1. i have two panel, admin and client
2. how i can set only specific role to be able to access admin panel
3. the other roles can only see client.
4. admin user of course can see both client and admin panel
how i can achieve this? i already got both panels and got shield plugin. thank you
8 Replies
There is a method called
authMiddleware
that is called when someone is visiting the panel you can put your logic there...
The user model has a canAccessPanel function
means i can use something like this? but how i get to the correct panel by checking roles, i have role super_admin and client
since you're in the user model, you can access the instance. like $this->where(...)
and im using shield
same thing $this->can('permission') or other method
Solution
$this = User model instance