Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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
Copy link

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

@merwok

This comment has been minimized.

Copy link
Contributor

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.

@mmerickel

This comment has been minimized.

Copy link
Member

commented Mar 19, 2013

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

@mmerickel mmerickel closed this Mar 19, 2013

JocelynDelalande added a commit to JocelynDelalande/autonomie that referenced this issue Nov 1, 2018

Fix CroissanceCommune#810 : Cesse d'utiliser property pour définir __…
…acl__

Cela complexifiait le debug lorsque le code d'une ACL déclenchait une
AttributeError car Pyramid ignorait cette dernière silencieusement.

Je ne vois pas d'inconvénient à ce nouveau fonctionnement.

Ref Pylons/pyramid#735
Ref CroissanceCommune/autonomie_base#2

sbodrero added a commit to sbodrero/autonomie that referenced this issue Nov 10, 2018

Fix CroissanceCommune#810 : Cesse d'utiliser property pour définir __…
…acl__

Cela complexifiait le debug lorsque le code d'une ACL déclenchait une
AttributeError car Pyramid ignorait cette dernière silencieusement.

Je ne vois pas d'inconvénient à ce nouveau fonctionnement.

Ref Pylons/pyramid#735
Ref CroissanceCommune/autonomie_base#2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.