Commit 6d162dc0 authored by Evan Simpson's avatar Evan Simpson

Fix calls to DTML to use new security properly.

parent f0c41431
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
Handler for Python expressions that uses the RestrictedPython package. Handler for Python expressions that uses the RestrictedPython package.
""" """
__version__='$Revision: 1.5 $'[11:-2] __version__='$Revision: 1.6 $'[11:-2]
from AccessControl import full_read_guard, full_write_guard, \ from AccessControl import full_read_guard, full_write_guard, \
safe_builtins, getSecurityManager safe_builtins, getSecurityManager
...@@ -130,11 +130,14 @@ class _SecureModuleImporter: ...@@ -130,11 +130,14 @@ class _SecureModuleImporter:
return mod return mod
from DocumentTemplate.DT_Util import TemplateDict, InstanceDict from DocumentTemplate.DT_Util import TemplateDict, InstanceDict
from AccessControl.DTML import RestrictedDTML
class Rtd(RestrictedDTML, TemplateDict):
this = None
def call_with_ns(f, ns, arg=1): def call_with_ns(f, ns, arg=1):
td = TemplateDict() td = Rtd()
td.this = None
td._push(ns['request']) td._push(ns['request'])
td._push(InstanceDict(ns['here'], td, guarded_getattr)) td._push(InstanceDict(ns['here'], td))
td._push(ns) td._push(ns)
try: try:
if arg==2: if arg==2:
......
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