Closed Joorren closed 7 months ago
Hi there,
DELETE API will always return 200 as it would allow batch deletion of resources. However, Laravel\Nova\Http\Requests\DeleteResourceRequest
will always check for authorizeToDelete()
and prevent the deletion. This are being tested and covered by our integration tests.
You should be testing if the correct records get deleted by checking model/database records exists instead of status code.
Description:
When trying to remove a resource with a user that does not have permission to remove the resource, the API would still return status code 200, even though the resource can't and won't be removed. Because the user isn't permitted to remove the resource, status code 403 would be expected.
I can only trigger this logic from unit testing, as the 'remove resource' button correctly doesn't show in the front-end.
Detailed steps to reproduce the issue on a fresh Nova installation: