Resource policy issue
From the docs, edit route should only check the
update()
policy method. Now, I have this weird issue of it checking the viewAny()
method. What may I be doing wrong?
StaffPolicy.php
StaffTest.php
Console output:
4 Replies
viewAny controls access to the whole resource
it checks that first, then it checks update
Alrighty. Thanks Dan
Is there any way I can limit checks to only the required policy? I want members of staff to be able to view and edit own staff resource, not viewAny (i.e. not view list of members of staff)
Adjust query accordingly
Or add global scope
Thank you Krekas