[Zope] Passing auth info to ZPublisher.Zope(url, pm=1) when debugging

Jeff Kowalczyk jtk@yahoo.com
Fri, 4 Oct 2002 10:11:20 -0400


I found information in the Zope Dev Guide about debugging, but the particular error I'm
trying to debug comes on a formulator management screen (when I save properties or
test/validate a customized datetime field), and it needs user authorization. Is there any
documentation on how I should pass user auth info to the ZPublisher.Zope(url, pm=1) method
when calling it directly from python? Thanks.

>>> ZPublisher.Zope('/Formulator/edi1/dt1/manage_edit', pm=1)
Traceback (most recent call last):
  File "<interactive input>", line 1, in ?
  File "C:\Program Files\Zope\lib\python\ZPublisher\__init__.py", line 42, in Zope
    return apply(test, ('Zope',)+args, kw)
  File "C:\PROGRA~1\Zope\lib\python\ZPublisher\Test.py", line 368, in publish
    publish_module_pm(file, environ=env, stdout=stdout, extra=extra)
  File "C:\PROGRA~1\Zope\lib\python\ZPublisher\Test.py", line 229, in publish_module_pm
    response = publish(request, module_name, after_list, debug=debug)
  File "C:\Program Files\Zope\lib\python\ZPublisher\Publish.py", line 114, in publish
    sys.exc_info()[2],
  File "C:\PROGRA~1\Zope\lib\python\Zope\__init__.py", line 159, in
zpublisher_exception_hook
    f(client, REQUEST, t, v, traceback)
  File "C:\Program Files\Zope\lib\python\ZPublisher\Publish.py", line 89, in publish
    object=request.traverse(path, validated_hook=validated_hook)
  File "C:\PROGRA~1\Zope\lib\python\ZPublisher\BaseRequest.py", line 404, in traverse
    response.unauthorized()
  File "C:\Program Files\Zope\lib\python\ZPublisher\HTTPResponse.py", line 533, in
unauthorized
    raise Unauthorized, m
Unauthorized: <html><head><title>dt1</title></head><body bgcolor="#FFFFFF">

 <strong>You are not authorized to access this resource.</strong>
<p><a href="http://www.zope.org/Credits" target="_top"><img
src="http://127.0.0.1/Zope/p_/ZopeButton" width="115" height="50" border="0" alt="Powered
by Zope" /></a></p></body></html>

>>>