[Zope] First python script in zope - import problem (permissions)

Joshua Lanza jlanza@vorsite.com
Thu, 20 Dec 2001 18:06:06 -0800


Hi,

I have created a new script object called get_timestamp. I put the
following code in there:

import time
return int(time.time())

When I try to test it, I get user and password prompt and Unauthorized.
Something else I need to do?=20


Here's the trace:

<!--

Traceback (innermost last):
  File C:\PROGRA~1\zope2\lib\python\ZPublisher\Publish.py, line 223, in
publish_module
  File C:\PROGRA~1\zope2\lib\python\ZPublisher\Publish.py, line 187, in
publish
  File C:\PROGRA~1\zope2\lib\python\ZPublisher\Publish.py, line 171, in
publish
  File C:\PROGRA~1\zope2\lib\python\ZPublisher\mapply.py, line 160, in
mapply
    (Object: get_timestamp)
  File C:\PROGRA~1\zope2\lib\python\ZPublisher\Publish.py, line 112, in
call_object
    (Object: get_timestamp)
  File C:\PROGRA~1\zope2\lib\python\Shared\DC\Scripts\Bindings.py, line
324, in __call__
    (Object: get_timestamp)
  File C:\PROGRA~1\zope2\lib\python\Shared\DC\Scripts\Bindings.py, line
354, in _bindAndExec
    (Object: get_timestamp)
  File
C:\PROGRA~1\zope2\lib\python\Products\PythonScripts\PythonScript.py,
line 363, in _exec
    (Object: get_timestamp)
    (Info: ({'script': &lt;PythonScript instance at 01088950&gt;,
'context': &lt;Application instance at 00FA8580&gt;, 'container':
&lt;Application instance at 00FA8580&gt;, 'traverse_subpath': []}, (),
{}, None))
  File Script (Python), line 2, in get_timestamp
    (Object: guarded_getattr)
  File C:\PROGRA~1\zope2\lib\python\AccessControl\ZopeGuards.py, line
122, in guarded_getattr
    (Object: time)
  File C:\PROGRA~1\zope2\lib\python\AccessControl\SecurityManager.py,
line 149, in validate
  File C:\PROGRA~1\zope2\lib\python\AccessControl\ZopeSecurityPolicy.py,
line 172, in validate
Unauthorized: time

-->