[Zope-CMF] [dev] Unauthorized confusion and Zope 2.4 compatibility
Yuppie
schubbe at web.de
Mon Jan 5 15:11:19 EST 2004
Hi!
Zope has two different Unauthorized exceptions:
AccessControl.Unauthorized is a subclass of zExceptions.Unauthorized.
The usage of the two exceptions is more or less random.
See also this mail and thread:
<http://mail.zope.org/pipermail/zope-coders/2003-November/004346.html>
This issue isn't resolved in Zope, but even if it would be resolved in
Zope 2.7 we have to find a solution that works with older Zope versions.
I propose to use zExceptions.Unauthorized to catch Unauthorized (catches
both) and AccessControl.Unauthorized to raise Unauthorized (can be
catched by both).
CMFCoreExceptions.CMFUnauthorizedError is already a subclass of
AccessControl.Unauthorized and could be used to raise Unauthorized.
CMFCoreExceptions.Unauthorized could become an alias of
zExceptions.Unauthorized.
Any better ideas?
The issue becomes more complicated if we try to be Zope 2.4 compatible:
In Zope 2.4 zExceptions.Unauthorized didn't exist and
AccessControl.Unauthorized was a string exception.
Is there any good reason to maintain Zope 2.4 compatibility?
INSTALL.txt says:
Requirements
- Zope v. 2.5 and later
o Note: Zope v. 2.4.3 *may* work, but is no longer a supported
version.
I don't like to care any longer about Zope 2.4. I propose to remove that
note and import zExceptions.Unauthorized without handling an ImportError.
Comments are welcome!
Cheers,
Yuppie
More information about the Zope-CMF
mailing list