[PEAK] peak.security: permissionFor problem

Phillip J. Eby pje at telecommunity.com
Fri Feb 11 15:20:27 EST 2005


At 07:44 PM 2/11/05 +0100, Radek Kanovsky wrote:
>On Fri, Feb 11, 2005 at 01:15:12PM -0500, Phillip J. Eby wrote:
>
> > >> I wish you could send me a reproducable case, I have lots of things I'd
> > >> like to check.
> > >
> > >I have finally succeeded. The attached code raises AM exception on my
> > >computer.
> >
> > What Python version?  I ran the code on 2.3.4 and it didn't raise an error.
>
>2.3.4 too. I have checkouted fresh PEAK from CVS for sure. Problem then
>disappear but I have made a few changes in my working PEAK (mainly for
>debuging purposes). One of changes declared additional permission. Try
>following change in peak/web/places.py on line 141:
>
>-    place_url = binding.Make(place_url)
>+    place_url = binding.Make(place_url, security.Anybody)
>
>Then exception should appear again.

Okay, got it and killed it.  It was subtler than I thought; it was a 
problem where multiple dispatch nodes doing a 'reseed()' for the same 
multiple-inheritance class would cause a method to get added to 
subsequently-generated dispatch maps.  The symptom is thus hard to provoke 
without a very exact set of steps.  However, once the issue is understood 
it is trivial to detect and test for in a unit test, so I have checked in a 
fix.

Again, the source of the trouble was CriterionIndex's new algorithm, which 
shows me that I really should have had unit tests for its functionality 
from the outset.  But it was replacing existing code that seemed adequately 
covered by integration tests.  So, I'm thinking that in future I need to 
write more unit tests for such refactorings distinct from existing 
integration tests.




More information about the PEAK mailing list