[Zope3-checkins]
SVN: Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/
Changed to import removeSecurityProxy from zope.security.proxy
Jim Fulton
jim at zope.com
Fri Aug 27 20:43:54 EDT 2004
Log message for revision 27321:
Changed to import removeSecurityProxy from zope.security.proxy
Changed:
U Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/classmodule/browser.py
U Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/ifacemodule/browser.py
U Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/ifacemodule/menu.py
U Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/utilities.py
U Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/zcmlmodule/browser.py
-=-
Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/classmodule/browser.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/classmodule/browser.py 2004-08-28 00:43:51 UTC (rev 27320)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/classmodule/browser.py 2004-08-28 00:43:53 UTC (rev 27321)
@@ -30,6 +30,7 @@
from zope.interface import implementedBy
from zope.interface.interface import InterfaceClass
from zope.schema import getFieldsInOrder
+from zope.security.proxy import removeSecurityProxy
import zope.app
from zope.app import zapi
@@ -133,7 +134,7 @@
self.request = request
# TODO: This is not the best way to do this. We really need to revisit
# the entire implementation and move more to the ZCMLFile object.
- package = zapi.removeSecurityProxy(
+ package = removeSecurityProxy(
zapi.getParent(context))._Module__module
# Keep track of the package that is used for relative paths
self._package_stack = [package]
@@ -510,7 +511,7 @@
# we have to remove the security wrapper to get to the API calls.
checker = self.context.getSecurityChecker()
entry.update(
- getPermissionIds(name, zapi.removeSecurityProxy(checker)))
+ getPermissionIds(name, removeSecurityProxy(checker)))
attrs.append(entry)
return attrs
@@ -550,7 +551,7 @@
#
# `getPermissionIds()` also expects the class's security checker not
# to be proxied.
- klass = zapi.removeSecurityProxy(self.context)
+ klass = removeSecurityProxy(self.context)
for name, attr, iface in klass.getMethods():
entry = {'name': name,
'signature': getFunctionSignature(attr),
@@ -672,7 +673,7 @@
crumbs = []
module = self.context
# I really need the class here, so remove the proxy.
- while zapi.removeSecurityProxy(module).__class__ is Module:
+ while removeSecurityProxy(module).__class__ is Module:
crumbs.append(
{'name': zapi.name(module),
'url': zapi.getView(module, 'absolute_url', self.request)()}
Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/ifacemodule/browser.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/ifacemodule/browser.py 2004-08-28 00:43:51 UTC (rev 27320)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/ifacemodule/browser.py 2004-08-28 00:43:53 UTC (rev 27321)
@@ -23,6 +23,7 @@
from zope.interface.interfaces import IMethod, IInterface
from zope.proxy import removeAllProxies
from zope.schema.interfaces import IField
+from zope.security.proxy import removeSecurityProxy
from zope.app import zapi
from zope.app.i18n import ZopeMessageIDFactory as _
@@ -246,7 +247,7 @@
# __module__ attribute. If we only remove security proxies, the
# location proxy's module will be returned.
return renderText(self.context.__doc__,
- zapi.removeSecurityProxy(self.context).__module__)
+ removeSecurityProxy(self.context).__module__)
def getBases(self):
"""Get all bases of this class
@@ -431,7 +432,7 @@
service = zapi.getService('Adapters')
# Must remove security proxies, so that we have access to the API
# methods.
- iface = zapi.removeSecurityProxy(self.context)
+ iface = removeSecurityProxy(self.context)
adapters = []
for reg in service.registrations():
# Only grab the adapters for which this interface is required
Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/ifacemodule/menu.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/ifacemodule/menu.py 2004-08-28 00:43:51 UTC (rev 27320)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/ifacemodule/menu.py 2004-08-28 00:43:53 UTC (rev 27321)
@@ -22,6 +22,7 @@
__docformat__ = 'restructuredtext'
from zope.interface import implements
+from zope.security.proxy import removeSecurityProxy
from zope.app import zapi
from zope.app.location.interfaces import ILocation
@@ -113,7 +114,7 @@
def getChildObjects(self):
"""See zope.app.tree.interfaces.IChildObject"""
objects = {}
- names = zapi.removeSecurityProxy(self.context.keys())
+ names = removeSecurityProxy(self.context.keys())
names.sort()
for name in names:
# Split these long names and make part of the module path separate
Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/utilities.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/utilities.py 2004-08-28 00:43:51 UTC (rev 27320)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/utilities.py 2004-08-28 00:43:53 UTC (rev 27321)
@@ -28,6 +28,7 @@
from zope.publisher.browser import TestRequest
from zope.security.checker import getCheckerForInstancesOf, Global
from zope.security.interfaces import INameBasedChecker
+from zope.security.proxy import removeSecurityProxy
from zope.app import zapi
from zope.app.i18n import ZopeMessageIDFactory as _
@@ -157,7 +158,7 @@
# Even for methods `im_class` and `__module__` is not allowed to be
# accessed (which is probably not a bad idea). So, we remove the security
# proxies for this check.
- naked = zapi.removeSecurityProxy(obj)
+ naked = removeSecurityProxy(obj)
if hasattr(naked, "im_class"):
naked = naked.im_class
module = naked.__module__
Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/zcmlmodule/browser.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/zcmlmodule/browser.py 2004-08-28 00:43:51 UTC (rev 27320)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/zcmlmodule/browser.py 2004-08-28 00:43:53 UTC (rev 27321)
@@ -18,6 +18,7 @@
__docformat__ = 'restructuredtext'
from zope.configuration.xmlconfig import ParserInfo
+from zope.security.proxy import removeSecurityProxy
from zope.app import zapi
from zope.app.location import LocationProxy
@@ -167,7 +168,7 @@
# ZCML directive `info` objects do not have security declarations, so
# everything is forbidden by default. We need to remove the security
# proxies in order to get to the data.
- info = zapi.removeSecurityProxy(self.context.info)
+ info = removeSecurityProxy(self.context.info)
if zapi.isinstance(info, ParserInfo):
return {'file': relativizePath(info.file),
'line': info.line,
More information about the Zope3-Checkins
mailing list