You already have a Resource Tree by creating a Root resource in your project. You just need to add a node to it for posts , which will return a Post object with a specific __acl__ that contains only the authorized user ID. Then you can use the edit_posts traverse='/posts/{post_id}' route edit_posts traverse='/posts/{post_id}' resource tree to the Post object using __acl__ on it.
It's not complicated, and this is the way to get Pyramid to do it for you.
If you do not want to use the permission argument, you can do authorization inside the view itself, as Kirk suggested.
In addition, if you do not like this method of adding __acl__ properties and workarounds for authorization, you can implement your own AuthorizationPolicy to do what you would like to do with this list of principles and permission.
The point of the Pyramid auth system is that it is there, which is great. Pyramid by no means requires you to use it, and for views that do not use it, there is no effect on the performance of working with it.
source share