[Zope-Checkins] CVS: Zope3/lib/python/Interface - Implements.py:1.1.2.3

Jim Fulton jim@zope.com
Sun, 28 Apr 2002 13:17:04 -0400


Update of /cvs-repository/Zope3/lib/python/Interface
In directory cvs.zope.org:/tmp/cvs-serv17050/lib/python/Interface

Modified Files:
      Tag: Zope-3x-branch
	Implements.py 
Log Message:
HOTYB: Merged SecurityProxy-branch into main branch.  

All tests pass and folders can be listed and added through the web.
It is likely that most other things don't work and will need to be
fixed. The reason is that many accesses that should have been checked
before are now being checked and additional checks and thinking about
permissions and security settings are needed.

I'm in the process of drafting a paper for the wiki that describes the
changes in more detail.


=== Zope3/lib/python/Interface/Implements.py 1.1.2.2 => 1.1.2.3 ===
 CLASS_INTERFACES = 1
 
-try:
-    import ExtensionClass
-except ImportError:
-    ClassTypes = (ClassType, type(object))
-else:
-    class dummy (ExtensionClass.Base): pass
-    ClassTypes = (type(dummy), ClassType, type(object))
+ClassTypes = (ClassType, type(object))
 
 _typeImplements={}
 
@@ -54,11 +48,6 @@
             return klass.__implements__
         else:
             return None
-    elif hasattr(klass, 'instancesImplements'):
-        # Hook for ExtensionClass. :)
-        # XXX Potential security problem since "instancesImplements"
-        # is a valid Zope identifier.
-        return klass.instancesImplements()
     else:
         return tiget(klass, None)
 
@@ -70,6 +59,7 @@
     If the visitor returns anything true, the loop stops.
     This does not, and should not, visit superinterfaces.
     """
+
     if isinstance(implements, InterfaceClass):
         return visitor(implements)
     elif implements == CLASS_INTERFACES: