Skip to content

Commit

Permalink
Add "Object" constructor to standard Script library. See collector #490
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Simpson committed Sep 4, 2002
1 parent 7bd9225 commit a25b3fb
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion standard.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"import Products.PythonScripts.standard"
"""

__version__='$Revision: 1.10 $'[11:-2]
__version__='$Revision: 1.11 $'[11:-2]

from AccessControl import ModuleSecurityInfo, getSecurityManager
security = ModuleSecurityInfo()
Expand Down Expand Up @@ -53,4 +53,18 @@ def __call__(self, client=None, REQUEST={}, RESPONSE=None, **kw):

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())

0 comments on commit a25b3fb

Please sign in to comment.