Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: Users

Python scripts

 

 

Zope users RSS feed   Index | Next | Previous | View Threaded


richard at scholarpack

Jul 6, 2012, 5:09 AM

Post #1 of 2 (271 views)
Permalink
Python scripts

Hi

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?
Thanks
Rich


l at lrowe

Jul 6, 2012, 5:30 AM

Post #2 of 2 (258 views)
Permalink
Re: Python scripts [In reply to]

On 6 July 2012 14:09, Richard Harley <richard [at] scholarpack> 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
_______________________________________________
Zope maillist - Zope [at] zope
https://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope-dev )

Zope users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.