[Zope3-checkins] CVS: Zope3/src/zope/app/utility/browser -
__init__.py:1.5
Garrett Smith
garrett at mojave-corp.com
Fri Apr 9 10:05:53 EDT 2004
Update of /cvs-repository/Zope3/src/zope/app/utility/browser
In directory cvs.zope.org:/tmp/cvs-serv8788/src/zope/app/utility/browser
Modified Files:
__init__.py
Log Message:
Added a trustedRemoveSecurityProxies -- the interfaces being returned by
providedBy are proxied. This fixes a bug that prevented various utilities
from being registered.
=== Zope3/src/zope/app/utility/browser/__init__.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/utility/browser/__init__.py:1.4 Thu Mar 18 12:01:13 2004
+++ Zope3/src/zope/app/utility/browser/__init__.py Fri Apr 9 10:05:52 2004
@@ -24,6 +24,7 @@
from zope.app import zapi
from zope.interface import providedBy
from zope.proxy import removeAllProxies
+from zope.security.proxy import trustedRemoveSecurityProxy
from zope.app.introspector import interfaceToName
class UtilityInterfaceWidget(InterfaceWidget):
@@ -35,6 +36,7 @@
component = field.context
result = ['\n<select name="%s">' % self.name]
for interface in providedBy(component).flattened():
+ interface = trustedRemoveSecurityProxy(interface)
result.append(' <option value="%s.%s">%s</option>' %
(interface.__module__, interface.getName(),
interface.getName()))
@@ -195,6 +197,7 @@
folder = zapi.getParent(self.context)
iface = folder.resolve(self.request['interface'])
name = self.request['name']
+ # XXX should this be trustedRemoveSecurityProxy?
iface = removeAllProxies(iface)
regstack = self.context.queryRegistrations(name, iface)
form = zapi.getView(regstack, "ChangeRegistrations", self.request)
More information about the Zope3-Checkins
mailing list