[Zope-Checkins] CVS: Zope2 - DTMLMethod.py:1.62.2.1 FindSupport.py:1.23.46.2

shane@digicool.com shane@digicool.com
Thu, 26 Apr 2001 18:25:40 -0400 (EDT)


Update of /cvs-repository/Zope2/lib/python/OFS
In directory korak:/tmp/cvs-serv10837/lib/python/OFS

Modified Files:
      Tag: RestrictedPythonBranch
	DTMLMethod.py FindSupport.py 
Log Message:
Modified the way DTML namespaces implement security: now there is an
attribute of TemplateDicts called read_guard which implements the
"read guard" interface as defined by RestrictedPython.



--- Updated File DTMLMethod.py in package Zope2 --
--- DTMLMethod.py	2001/04/16 18:21:40	1.62
+++ DTMLMethod.py	2001/04/26 22:25:08	1.62.2.1
@@ -102,6 +102,7 @@
 import  Globals, sys, Acquisition
 from AccessControl import getSecurityManager
 from Cache import Cacheable
+from RestrictedPython.ZopeGuards import full_read_guard
 
 _marker = []  # Create a new marker object.
 
@@ -261,8 +262,8 @@
     # deprecated; use get_size!
     getSize=get_size
 
-    def validate(self, inst, parent, name, value, md):
-        return getSecurityManager().validate(inst, parent, name, value)
+    def read_guard(self, ob):
+        return full_read_guard(ob)
 
     manage_editForm=DTMLFile('dtml/documentEdit', globals())
 

--- Updated File FindSupport.py in package Zope2 --
--- FindSupport.py	2001/04/25 20:26:36	1.23.46.1
+++ FindSupport.py	2001/04/26 22:25:08	1.23.46.2
@@ -94,6 +94,7 @@
 from DateTime import DateTime
 from string import find
 from AccessControl import getSecurityManager
+from RestrictedPython.ZopeGuards import full_read_guard
 
 class FindSupport(ExtensionClass.Base):
     """Find support for Zope Folders"""
@@ -307,8 +308,8 @@
 
 class td(TemplateDict):
 
-    def validate(self, inst, parent, name, value, md):
-        return getSecurityManager().validate(inst, parent, name, value)
+    def read_guard(self, ob):
+        return full_read_guard(ob)
 
 
 def expr_match(ob, ed, c=InstanceDict, r=0):