[Zope-Checkins] CVS: Zope3/lib/python/Zope/Security - Checker.py:1.1.4.5.4.3

Steve Alexander steve@cat-box.net
Tue, 4 Jun 2002 08:03:08 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/Security
In directory cvs.zope.org:/tmp/cvs-serv26586/lib/python/Zope/Security

Modified Files:
      Tag: Zope3InWonderland-branch
	Checker.py 
Log Message:
some formatting fixes.

Also, created an InsecureMarker class, instances of which don't get
wrapped in a security proxy (i.e. are Rocks), for use in methods where
you want to call a method with a default value, and compare the value
using 'is' later on.


=== Zope3/lib/python/Zope/Security/Checker.py 1.1.4.5.4.2 => 1.1.4.5.4.3 ===
 import sys, os, types
 
+class InsecureMarker(object):
+    """Instances of this class do not get wrapped by
+       security proxies. Use instances as markers
+       for methods like:
+          container.queryObject(name, default)
+    """
+    pass
+
 if os.environ.get('ZOPE_WATCH_CHECKERS'):
     WATCH_CHECKERS = 1
 else:
@@ -269,6 +277,7 @@
                                   'isImplementedBy', 'extends'])
 
 BasicTypes = {
+    InsecureMarker: NoProxy,
     int: NoProxy,
     float: NoProxy,
     long: NoProxy,