Unable to login when create new role
Hi everyone,
I am using bezhanSalleh/filament-shield package to created a new role. I created new role called "view_data," which only allows viewing data. Then, I created a new user and assigned this "view_data" role to him. However, when he tries to log in, it shows a "403 Forbidden" error. How can I fix this issue? Can anyone help me with this?
I am using bezhanSalleh/filament-shield package to created a new role. I created new role called "view_data," which only allows viewing data. Then, I created a new user and assigned this "view_data" role to him. However, when he tries to log in, it shows a "403 Forbidden" error. How can I fix this issue? Can anyone help me with this?
Solution
The HasPanelShield trait provides an implementation for the canAccessPanel method, determining access based on whether the user possesses the super_admin role or the panel_user role. It also assigns the panel_user role to the user upon creation and removes it upon deletion. Ofcourse the role names can be changed from the plugin's configuration file.
It's not an issue but the intended use case if you read the docs.