Hi, I'm trying to write a simple Python script for a ZClass that concatenates together a bunch of text files in a folder.

Here's what I have so far:

request = container.REQUEST
   response = request.RESPONSE
   responseLines = []
   for obj in context.objectValues('File'):
   return "\n".join(responseLines)
Now, it works fine in a regular directory, but when I access it via an instance of my ZClass, it generates an Unauthorized error. Here's the traceback:

  • Module ZPublisher.Publish, line 175, in publish_module_standard
  • Module ZPublisher.Publish, line 132, in publish
  • Module Zope.App.startup, line 204, in zpublisher_exception_hook
  • Module ZPublisher.Publish, line 101, in publish
  • Module ZPublisher.mapply, line 88, in mapply
  • Module ZPublisher.Publish, line 39, in call_object
  • Module Shared.DC.Scripts.Bindings, line 306, in __call__
  • Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec
  • Module Products.PythonScripts.PythonScript, line 323, in _exec
  • Module None, line 6, in all.js

    <PythonScript at /test/store/widget/ui/lib/all.js>

    Line 6
  • Module Shared.DC.Scripts.Bindings, line 178, in __getattr__
Unauthorized: You are not allowed to access 'objectValues' in this context (Also, an error occurred while attempting to render the standard error message.)
Any help at all in this would be greatly appreciated.