-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unhandled Exception on CRUD::setAccessCondition() #590
Comments
Hey @pxpm An exception is being logged whenever the user doesn't have access. It is not only limited to I don't think that is intentional; even if it is, it should be a warning or info, not an error. |
It throws a http unauthorized exception with forbidden (403) status: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403 Similar if you navigate to a non-existent page you get a 404. If you think it's worth adding to the docs a description of what we talked here, go ahead and add a note in the docs about Cheers |
Hey @pxpm |
@karandatwani92 that depends on your log level settings I guess. Maybe you are looking to don't report some exceptions? https://laravel.com/docs/11.x/errors#ignoring-exceptions-by-type |
Hi @karandatwani92, This is functionality of "Backpack" I guess. In log once any page is 403 forbidden for our reference,, |
Hey @munjaldevelopment . We use |
I got back here with a fresh perspective, and I think I got what you guys where trying to say. I did some digging and I found that Laravel itself already excludes some status codes from being reported like 419 for eg. In that regard I think we can make our exception extend one that Laravel already don't report on, so it will not be logged like before. The @munjaldevelopment screenshot was very helpful, if it had some description of where I should look for it would have helped more from the start, but it is what it is. Thanks for the report and for sticking with us 🙏 I will tag a new version later today that will have Laravel-Backpack/CRUD#5642 merged. Cheers |
If a reseller tries to open up a Company entity without having permissions, an exception is thrown and logged in laravel.log:
Docs do not mention that exceptions are thrown by CRUD::setAccessCondition()(related section: https://backpackforlaravel.com/docs/6.x/crud-operations#handling-access-to-operations).
I think it would be better to show how to correctly handle that. Thank you in advance!
The text was updated successfully, but these errors were encountered: