[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZMI - ZMIViewService.py:1.1.2.10.6.2

Jim Fulton jim@zope.com
Sat, 27 Apr 2002 12:59:22 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/ZMI
In directory cvs.zope.org:/tmp/cvs-serv26931/lib/python/Zope/App/ZMI

Modified Files:
      Tag: SecurityProxy-branch
	ZMIViewService.py 
Log Message:
Moved security management modules to Zope.Security.

Added like_unto attribute to protect class so you can say that a class
has the same protections as another class::

  <security:protectClass name=".RootFolder." like_unto=".Folder." />

Added some additional calls to removeAllProxies in some component
lookup code while debugging integration of new security model.

Added protections for BTree types.


=== Zope3/lib/python/Zope/App/ZMI/ZMIViewService.py 1.1.2.10.6.1 => 1.1.2.10.6.2 ===
 from IZMIViewService import IZMIViewService
 from Interface.Implements import objectImplements, flattenInterfaces
-
-
 from Zope.Proxy.ContextWrapper import getWrapperContainer
 from Zope.ComponentArchitecture import getAdapter
 from Zope.App.Traversing.ITraverser import ITraverser
-from Zope.App.Security.SecurityManagement import getSecurityManager
+from Zope.Security.SecurityManagement import getSecurityManager
 from Zope.PageTemplate.EngineConfig import getEngine
+from Zope.Proxy.ProxyIntrospection import removeAllProxies
+
+
 class ZMIViewService:
     
     __implements__ = IZMIViewService
@@ -45,7 +46,9 @@
         
         res = []
         
-        obj_interfaces = flattenInterfaces(objectImplements(object))
+        obj_interfaces = flattenInterfaces(objectImplements(
+            removeAllProxies(object)
+            ))
 
         for interface in obj_interfaces:
             
@@ -80,7 +83,6 @@
             'context': object,
             'view': getWrapperContainer(object),
             'nothing': None,
-        #    'request': getattr( object, 'REQUEST', None ),
             'user': getSecurityManager().getPrincipal(),
             }
         return getEngine().getContext(data)