In my opinion Tres&#39;s way is the correct one for this case<br><br>Why? Because the original must be is to run the script only for internal processes<br><br>The main diference between an internal call and a user one is the REQUEST parameter and then the Tres&#39;s solution seems the more convenient way<br>
<br>It&#39;s only my opinion<br><br><div class="gmail_quote">2009/4/28 Jaroslav Lukesh <span dir="ltr">&lt;<a href="mailto:lukesh@seznam.cz">lukesh@seznam.cz</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Why? It is more transparent and better way - use security tab.<br>
<div class="im"><br>
<br>
----- Original Message -----<br>
From: &quot;Tres Seaver&quot; &lt;<a href="mailto:tseaver@palladion.com">tseaver@palladion.com</a>&gt;<br>
<br>
<br>
</div><div class="im">&gt; -----BEGIN PGP SIGNED MESSAGE-----<br>
&gt; Hash: SHA1<br>
&gt;<br>
&gt; Pedro LaWrench wrote:<br>
&gt;&gt; I need to do something on the filesystem, which requires unrestricted<br>
&gt;&gt; python, so I created an external method. The problem is that anyone<br>
&gt;&gt; can call that directly via URL, so I added a permission check. Even<br>
&gt;&gt; then, users with the sufficient permissions can call this via URL,<br>
&gt;&gt; which I don&#39;t want them to do. I only want them to have access<br>
&gt;&gt; indirectly from other pages (such as a page template that will pass<br>
&gt;&gt; sane parameters). Is there anyway to do this?<br>
&gt;<br>
&gt; Add a REQUEST argument to your function, defaulting to None.  The<br>
&gt; publisher will always pass the request in for that argument, while the<br>
&gt; other templates / scripts should not.  E.g.:<br>
&gt;<br>
&gt; def doSomething(self, REQUEST=None):<br>
&gt;     &quot;&quot;&quot; Don&#39;t call me directly via a URL!!!<br>
&gt;     &quot;&quot;&quot;<br>
&gt;     if REQUEST is not None:<br>
&gt;         raise ValueError(&#39;Wicked, evil, naughty Zoot!&#39;)<br>
<br>
</div><div><div></div><div class="h5">_______________________________________________<br>
Zope maillist  -  <a href="mailto:Zope@zope.org">Zope@zope.org</a><br>
<a href="http://mail.zope.org/mailman/listinfo/zope" target="_blank">http://mail.zope.org/mailman/listinfo/zope</a><br>
**   No cross posts or HTML encoding!  **<br>
(Related lists -<br>
 <a href="http://mail.zope.org/mailman/listinfo/zope-announce" target="_blank">http://mail.zope.org/mailman/listinfo/zope-announce</a><br>
 <a href="http://mail.zope.org/mailman/listinfo/zope-dev" target="_blank">http://mail.zope.org/mailman/listinfo/zope-dev</a> )<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Mis Cosas<br><a href="http://blogs.sistes.net/Garito">http://blogs.sistes.net/Garito</a><br>Zope Smart Manager<br><a href="http://blogs.sistes.net/Garito/670">http://blogs.sistes.net/Garito/670</a><br>