[Zope3-checkins] CVS: Zope3/src/zope/app/security - _protections.py:1.3

Steve Alexander steve@cat-box.net
Wed, 12 Mar 2003 05:11:45 -0500


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

Modified Files:
	_protections.py 
Log Message:
__repr__ is now always allowed by security checkers.
This is important because you can always get around a restriction
on __repr__ by putting the object inside a tuple, dict or list, and
calling __repr__ on the tuple, dict, or list.

We discovered at Rotterdam that it is painful and non-intuitive to
protect __repr__ on tuples, dicts and lists.

So, it is better to make __repr__ publicly and obviously available.


=== Zope3/src/zope/app/security/_protections.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/security/_protections.py:1.2	Wed Dec 25 09:13:15 2002
+++ Zope3/src/zope/app/security/_protections.py	Wed Mar 12 05:11:14 2003
@@ -22,7 +22,7 @@
 
 
     # excluding _check, _bucket_type, _firstbucket, and write operations
-    _btreeChecker = NamesChecker(['__str__', '__repr__', '__contains__',
+    _btreeChecker = NamesChecker(['__str__', '__contains__',
                                   '__getitem__', '__iter__', '__len__',
                                   'byValue', 'get', 'has_key', 'items',
                                   'iteritems', 'iterkeys', 'itervalues',
@@ -30,22 +30,21 @@
 
     # excluding _next
     _btreeBucketChecker = NamesChecker([
-            '__contains__', '__getitem__', '__iter__', '__len__', '__repr__',
+            '__contains__', '__getitem__', '__iter__', '__len__',
             '__str__', 'byValue', 'get', 'has_key', 'items', 'iteritems',
             'iterkeys', 'itervalues', 'keys', 'maxKey','minKey', 'values'])
 
     _btreeSetChecker = NamesChecker([
-            '__contains__', '__getitem__', '__iter__', '__len__', '__repr__',
+            '__contains__', '__getitem__', '__iter__', '__len__',
             '__str__', 'has_key', 'insert', 'keys', 'maxKey', 'minKey'])
 
     # excluding _bucket_type, _check
     _btreeTreeSetChecker = NamesChecker([
-            '__contains__', '__iter__', '__len__', '__repr__',
+            '__contains__', '__iter__', '__len__',
             '__str__', 'has_key', 'insert', 'keys', 'maxKey', 'minKey'])
 
     _btreeItemsChecker = NamesChecker([
-            '__iter__', '__repr__', '__str__', '__getitem__', '__len__',
-            '__contains__'])
+            '__iter__', '__str__', '__getitem__', '__len__', '__contains__'])
 
     _iteratorChecker = NamesChecker(['next'])