As an admin I can open appointment 5b6e.... Signed in as a customer, GET /api/v1/crud/acme/appointment/5b6e... returns 404. Listing appointments as that customer returns only their own.
GET by UUID returns 404 for a record I can see in the console
Common question, written up by the Supero team.
404 Not Found1 answer
That's owner scoping. The customer's role has an access_rule on appointment with filter_field and filter_match set, for example customer_email matched to $user.email. With that rule, a get, update or delete by UUID on another user's row returns 404 rather than 403, so the response doesn't confirm the row exists. List and query reads add the filter automatically, which is why the list looks right.
On create, the filter field is stamped with the caller's own value, whatever the client sent. Stamping doesn't make the field immutable, so put it in readonly_fields too. filter_match takes exactly three values: $user.email, $user.uuid and $user.name.
If staff need every row, give their role a rule on the same entity without a filter. domain_admin and project_admin bypass object-level policy altogether.
Your answer
Know the answer? Sign in to post it. It takes an email address and a 6-digit code.
Sign in to answer