[Zope3-checkins] CVS: Zope3/src/zope/security - __init__.py:1.3 checker.py:1.23
Jim Fulton
jim@zope.com
Thu, 22 May 2003 15:41:02 -0400
Update of /cvs-repository/Zope3/src/zope/security
In directory cvs.zope.org:/tmp/cvs-serv19031
Modified Files:
__init__.py checker.py
Log Message:
Fixed several bugs in security assertions for builtin types (and their
methods).
=== Zope3/src/zope/security/__init__.py 1.2 => 1.3 ===
--- Zope3/src/zope/security/__init__.py:1.2 Wed Dec 25 09:15:21 2002
+++ Zope3/src/zope/security/__init__.py Thu May 22 15:40:32 2003
@@ -1,2 +1,7 @@
#
# This file is necessary to make this directory a package.
+
+
+# XXX There's a circular import problem with the proxy package.
+# The proxy framework needs some refactoring, but not today.
+import zope.proxy
=== Zope3/src/zope/security/checker.py 1.22 => 1.23 ===
--- Zope3/src/zope/security/checker.py:1.22 Sat May 3 12:38:17 2003
+++ Zope3/src/zope/security/checker.py Thu May 22 15:40:32 2003
@@ -435,15 +435,16 @@
_default_checkers = {
dict: NamesChecker(['__getitem__', '__len__', '__iter__',
- 'get', 'has_key', '__copy__', '__str__', 'keys',
+ 'get', 'has_key', 'copy', '__str__', 'keys',
'values', 'items', 'iterkeys', 'iteritems',
'itervalues', '__contains__']),
list: NamesChecker(['__getitem__', '__getslice__', '__len__', '__iter__',
- '__contains__', 'index', 'count', '__str__']),
+ '__contains__', 'index', 'count', '__str__',
+ '__add__', '__radd__', ]),
# YAGNI: () a rock
- tuple: NamesChecker(['__getitem__', '__getslice__', '__add__',
- '__contains__', '__len__', '__iter__', '__iadd__',
+ tuple: NamesChecker(['__getitem__', '__getslice__', '__add__', '__radd__',
+ '__contains__', '__len__', '__iter__',
'__str__']),
types.InstanceType: _instanceChecker,
Proxy: NoProxy,
@@ -452,10 +453,12 @@
types.MethodType: _callableChecker,
types.BuiltinFunctionType: _callableChecker,
types.BuiltinMethodType: _callableChecker,
+ type(().__getslice__): _callableChecker, # slot description
type: _typeChecker,
types.ModuleType: _moduleChecker,
type(iter([])): _iteratorChecker, # Same types in Python 2.2.1,
type(iter(())): _iteratorChecker, # different in Python 2.3.
+ type(iter({})): _iteratorChecker,
type(iter(_Sequence())): _iteratorChecker,
type(Interface): InterfaceChecker(IInterface, __str__=CheckerPublic),
ObjectSpecification: _InterfaceSpecification_checker,