I want to make RESTFul traversal-like resources with Pyramid and Cornice.
e.g.
/customers/{xxx}/invoices
/customers/{xxx}/invoices/{yyy}
/customers/{xxx}/invoices/{yyy}/pdf
... where at {xxx} path all the available customers for the user would be listed and if there are any customers for whom the user do not have a permission for the access is blocked.
I'd like to do this in traversal-like manner, so that I need to write access checks only once in well defined manner.
The URL format itself is not relevant; it can be path or query parameter. I just want to make sure the permission check is the same for all endpoints.
I am looking for methods to approach this problem.