Enhancement: can ACLAuthorizationPolicy support __acl__ as a callable? #735

Closed
twillis opened this Issue Nov 29, 2012 · 2 comments

Comments

Projects
None yet
3 participants

twillis commented Nov 29, 2012

Being a python newb I did not know that any error in property getters result in an AttributeError. I understand the rationale behind it, but it makes me a little anxious to have my "security" code blowing up silently and leaving the traversal "layer" in an unexpected state.

What would be nice is if the ACLAuthorizationPolicy could look out for acl that is a callable and deal with it that way. then errors will bubble up properly.

For now, I've embraced and extended for batterii's innovation platform, but I'm of the opinion it might be desired in pyramid as well.

https://gist.github.com/4169503

Contributor

merwok commented Mar 2, 2013

FTR I think the behavior your describe (any error in a property getter causing AttributeError) is actually a CPython bug, which may have been fixed in the latest version.

Owner

mmerickel commented Mar 19, 2013

I've merged this fix in aae62a0 and recommended its usage in the docs. Thanks for this solution.

mmerickel closed this Mar 19, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment