[Zope3-checkins] CVS: Zope3/src/zope/security/tests - test_checker.py:1.14

Marius Gedminas mgedmin@codeworks.lt
Thu, 5 Jun 2003 07:45:04 -0400


Update of /cvs-repository/Zope3/src/zope/security/tests
In directory cvs.zope.org:/tmp/cvs-serv11729/src/zope/security/tests

Modified Files:
	test_checker.py 
Log Message:
Documented the behavior of CombinedChecker explicitly.  Fixed a bug where
CombinedChecker could raise a ForbiddenAttribute instead of Unauthorized.

Documented Checker.permission_id and setattr_permission_id in an interface
(INameBasedChecker).

Remove the dependency on permission_id/setattr_permission_id from
CheckerLoggingMixin.  I do not think anyone cares about the distinction of
'Public' and 'Granted' when debugging checkers.

Make CombinedChecker log things when ZOPE_WATCH_CHECKERS is set.



=== Zope3/src/zope/security/tests/test_checker.py 1.13 => 1.14 ===
--- Zope3/src/zope/security/tests/test_checker.py:1.13	Mon Jun  2 13:43:04 2003
+++ Zope3/src/zope/security/tests/test_checker.py	Thu Jun  5 07:45:03 2003
@@ -476,6 +476,11 @@
             self.policy.checkChecked(['dc_get_permission', 'get_permission'])
             )
 
+        # This should raise Unauthorized instead of ForbiddenAttribute, since
+        # access can be granted if you e.g. login with different credentials.
+        self.assertRaises(Unauthorized, cc.check_getattr, self.obj, 'd_only')
+        self.assertRaises(Unauthorized, cc.check, self.obj, 'd_only')
+
     def test_interface(self):
         from zope.security.checker import CombinedChecker
         from zope.security.interfaces import IChecker