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.

  • Well, I just came across the same problem. Did you find a solution in the meanwhile? – Christian Benke May 13 '16 at 17:28
  • @ChristianBenke: Not yet, but will come up with my own solution this week – Mikko Ohtamaa May 17 '16 at 6:51
  • 1
    This remains me Kinto permissions, you might want to have a look at: servicedenuages.fr/en/handling-permissions – Natim May 18 '16 at 11:31

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.