[Zope3-checkins] SVN: Zope3/trunk/src/zope/security/checker.py The
check method can emit two types of exceptions and both should be
Stephan Richter
srichter at cosmos.phy.tufts.edu
Fri Sep 16 16:26:20 EDT 2005
Log message for revision 38493:
The check method can emit two types of exceptions and both should be
caught.
Changed:
U Zope3/trunk/src/zope/security/checker.py
-=-
Modified: Zope3/trunk/src/zope/security/checker.py
===================================================================
--- Zope3/trunk/src/zope/security/checker.py 2005-09-16 20:16:40 UTC (rev 38492)
+++ Zope3/trunk/src/zope/security/checker.py 2005-09-16 20:26:20 UTC (rev 38493)
@@ -95,7 +95,7 @@
checker = getChecker(obj)
try:
checker.check_setattr(obj, name)
- except Unauthorized:
+ except (Unauthorized, ForbiddenAttribute):
return False
# if it is Forbidden (or anything else), let it be raised: it probably
# indicates a programming or configuration error
@@ -113,7 +113,7 @@
checker = getChecker(obj)
try:
checker.check_getattr(obj, name)
- except Unauthorized:
+ except (Unauthorized, ForbiddenAttribute):
return False
# if it is Forbidden (or anything else), let it be raised: it probably
# indicates a programming or configuration error
More information about the Zope3-Checkins
mailing list