laravel-permission
laravel-permission copied to clipboard
Problem with denied access using the middleware aliases role, permission, and role_or_permission in Spatie Permission version 6 and higher.
I am facing an issue with the middleware aliases 'role', 'permission', and 'role_or_permission' in Spatie Permission version 6 and higher. I am using Laravel 10 along with the stancl/tenancy package. The problem is that even when the user does not have the necessary permissions, access continues to be allowed instead of being denied.
Steps to reproduce the issue:
- I installed Spatie Permission version 6.0 or higher and the stancl/tenancy package in my Laravel 10 project.
- I correctly configured Spatie Permission and created the necessary permissions and roles.
- I used the middleware aliases 'role', 'permission', and 'role_or_permission' in my routes to restrict access based on permissions and roles.
- Even when the user does not have the necessary permissions or roles, access is being allowed instead of being denied.
Expected: I expected that when using the middleware aliases 'role', 'permission', and 'role_or_permission', access would be correctly denied when the user does not have the necessary permissions or roles.
Current: Currently, even when the user does not have the necessary permissions or roles, access is being allowed instead of being denied.