Closed dardarwail closed 6 months ago
Hello, could you please try using the "DisableAuthorizations" on your resource to verify it's policies related ?
If it's working well with this trait, the problem might be related with your configuration. You could try debugging using tinker mostly 😄
Otherwise, please give me some details as I have tests running for this I might be missing something
Hello, Oops, my bad!
I forgot an important note:
By default, all gates and policies automatically return false if the incoming HTTP request was not initiated by an authenticated user.
Thanks a lot!
So the problem is not package related ?
Please have a look at Laravel Policies: https://laravel.com/docs/10.x/authorization#guest-users
No Not related to the package Thanks
Laravel Rest Api Version
2.3
Laravel Version
10.10
PHP Version
8.3
Database Driver & Version
No response
Description
Even if I add a UserPolicy file and return true in all methods (such as view and viewAny), I still receive the 'This action is unauthorized' message. I can't figure out if this is a bug or if I am doing something wrong! According to the documentation, I just need to associate my model with the policy.
Steps To Reproduce