filament shield Bezhan Salleh
I'm trying to generate policies in my Laravel project, but I'm encountering this error:
The given role or permission should use guard
web
instead of super_admin
.
It seems that I'm assigning a role or permission that was created with the super_admin guard to a user who is authenticated via the web guard. This causes a mismatch.
I’m not explicitly using the super_admin guard in my code, but I suspect it might have been set by default somewhere, or I may have created roles/permissions using a different guard.
How can I ensure that roles and permissions are assigned correctly for users authenticated with the web guard while generating policies?
Also, is there a way to check and fix existing roles/permissions to match the web guard?1 Reply
Please use #bezhansalleh-shield to result. But you can just edit them in the DB directly for exisitng roles/permissions assigned to a different guard.