Commit f85c290f authored by Evan Simpson's avatar Evan Simpson

Add "Object" constructor to standard Script library. See collector #490

parent 25827862
...@@ -18,7 +18,7 @@ Scripts. It can be accessed from Python with the statement ...@@ -18,7 +18,7 @@ Scripts. It can be accessed from Python with the statement
"import Products.PythonScripts.standard" "import Products.PythonScripts.standard"
""" """
__version__='$Revision: 1.10 $'[11:-2] __version__='$Revision: 1.11 $'[11:-2]
from AccessControl import ModuleSecurityInfo, getSecurityManager from AccessControl import ModuleSecurityInfo, getSecurityManager
security = ModuleSecurityInfo() security = ModuleSecurityInfo()
...@@ -53,4 +53,18 @@ class DTML(RestrictedDTML, HTML): ...@@ -53,4 +53,18 @@ class DTML(RestrictedDTML, HTML):
finally: security.removeContext(self) finally: security.removeContext(self)
from ZPublisher.HTTPRequest import record
security.declarePublic('Object')
# We don't expose classes directly to restricted code
class _Object(record):
_guarded_writes = 1
def __setitem__(self, key, value):
self.__dict__[str(key)] = value
def Object():
return _Object()
security.apply(globals()) security.apply(globals())
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment