[Zope-dev] RFC: backward compatibility of PythonScript bindings for 2.6.4 / 2.7.0

Dieter Maurer dieter at handshake.de
Wed Jan 21 14:17:40 EST 2004


Jeremy Hylton wrote at 2004-1-21 11:44 -0500:
>On Wed, 2004-01-21 at 10:42, Brian Lloyd wrote:
>> What I don't like is that it is somewhat magical, and now the 
>> error you would get (probably 'None has no attribute xxx') if 
>> the user doesn't have access to the container doesn't tell you 
>> the real problem. 
>
>What if you used a special object that would produce a useful error
>message if the user tries to access the container.  Assuming an access
>involves an attribute access:
>
>class UnauthorizedContext:
>
>    def __getattr__(self, attr):
>        raise Unauthorized("user does not have access to context")
>
>I'm sure the details aren't right, but I think the idea is clear enough.

+1

-- 
Dieter



More information about the Zope-Dev mailing list