[Zope-Checkins] CVS: Zope3/lib/python/Zope/Security - Checker.py:1.1.4.3
Steve Alexander
steve@cat-box.net
Wed, 1 May 2002 15:50:49 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/Security
In directory cvs.zope.org:/tmp/cvs-serv3437/lib/python/Zope/Security
Modified Files:
Tag: Zope-3x-branch
Checker.py
Log Message:
Added __bases__ to the list of public names for the type checker.
Added an InterfaceClass checker that allows the same names as for types.
This will probably need to be extended in the future.
Uncommented "allow services" code from the folder contents page template,
which had been not working due to the above not being there.
=== Zope3/lib/python/Zope/Security/Checker.py 1.1.4.2 => 1.1.4.3 ===
import Unauthorized, ForbiddenAttribute, Forbidden, DuplicationError
from Interface.IInterface import IInterface
+from Interface import Interface
from _Proxy import _Proxy as Proxy
from types import InstanceType, ClassType, FunctionType, MethodType, ModuleType
from ISecurityProxyFactory import ISecurityProxyFactory
from Zope.Security.SecurityManagement import getSecurityManager
import sys, os
-
if os.environ.get('ZOPE_WATCH_CHECKERS'):
WATCH_CHECKERS = 1
else:
@@ -261,7 +261,11 @@
_callableChecker = NamesChecker(['__str__', '__repr__', '__name__',
'__call__'])
-_typeChecker = NamesChecker(['__str__', '__repr__', '__name__', '__module__'])
+_typeChecker = NamesChecker(['__str__', '__repr__', '__name__', '__module__',
+ '__bases__'])
+
+_interfaceChecker = NamesChecker(['__str__', '__repr__', '__name__', '__module__',
+ '__bases__'])
BasicTypes = {
int: NoProxy,
@@ -294,6 +298,7 @@
type: _typeChecker,
ModuleType: _moduleChecker,
type(iter([])): NamesChecker(['next']),
+ type(Interface): _interfaceChecker,
}