[Zope] Problem with send in ZClass

Dieter Maurer dieter@handshake.de
Wed, 14 May 2003 20:46:18 +0200


Jamie White wrote at 2003-5-13 12:03 -0400:
 > I still need help with this
 > 
 > I built a ZClass and I want to send an email if a certain property is
 > missing, the script I am using to try to do this looks like this
 > 
 > # Send an Email
 > if draft == None:
 >    body="Content Provider " + AUTHENTICATED_USER.getUserName() + " has
 > completed work on. Please review for publishing"
 >    context.MailHost.send(body, mto="jamie@brobus.net",
 > mfrom="zope@brobus.net", subject="Content Done", encode=None)
 >    return body
 > else:
 >    return "No Message"
 > 
 > It works when I test it alone, but for some reason when it is run from
 > the zclass zope says:
 > Zope Error
 > 
 > Zope has encountered an error while publishing this resource.
 > 
 > Error Type: Unauthorized
 > Error Value: You are not allowed to access send in this context
 > I tried changing the proxy role on the script to manager but that didn't
 > help.

Shane's "VerboseSecurity" products is a valuable aid to analyse
"Unauthorized" exceptions...

The default permission mapping for ZClasses is very restrictive.
One of the most common problems with ZClasses is not to have
adjusted the mapping.


Dieter