[Zope] Python scripts

Richard Harley richard at scholarpack.com
Fri Jul 6 14:36:54 UTC 2012

That works great, thanks. So there is no way to do this across, say, a 
folder with hundreds of scripts in without duplicating the code in each 

On 06/07/12 13:30, Laurence Rowe wrote:
> On 6 July 2012 14:09, Richard Harley<richard at scholarpack.com>  wrote:
>> On Zope 2.10 is there a simple/universal way to only allow python scripts to
>> be called by DTML methods or other python scripts and not directly TTW?
> You can check that the script is not the published object with:
>      if container.REQUEST['PUBLISHED'] is script:
>          raise 'Forbidden'
> For newer versions of Zope raise an exception object:
>      from zExceptions import Forbidden
>      if container.REQUEST['PUBLISHED'] is script:
>          raise Forbidden('Script may not be published.')
> Laurence
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.zope.org/pipermail/zope/attachments/20120706/4a04c40e/attachment.html>

More information about the Zope mailing list