<div>Hi, </div>
<div>&nbsp;</div>
<div>I have couple of following settings in my etc\securitypolicy.zcml</div>
<div>&nbsp;</div>
<div>&nbsp; &lt;role id=&quot;zope.Anonymous&quot; title=&quot;Everybody&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; description=&quot;All users have this role implicitly&quot; /&gt;<br>&nbsp; &lt;!-- Replace the following directive if you don&#39;t want public access --&gt;<br>
&nbsp; &lt;grant permission=&quot;zope.View&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; role=&quot;zope.Anonymous&quot; /&gt;<br>&nbsp; &lt;grant permission=&quot;zope.app.dublincore.view&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; role=&quot;zope.Anonymous&quot; /&gt;<br>
</div>
<div>&nbsp;</div>
<div>I didn&#39;t use zope.Public on my resource directories.</div>
<div>&nbsp;</div>
<div>still able to acess them.</div>
<div>&nbsp;</div>
<div>I use the older zope 3.3 zope instances.</div>
<div>Not sure if this helps you.<br></div>
<div>With regards,</div>
<div>- Shailesh</div>
<div><br>&nbsp;</div>
<div class="gmail_quote">On Wed, Jul 9, 2008 at 5:44 PM, Roger Ineichen &lt;dev@projekt01.ch&gt; wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi Andrew<br><br>&gt; Betreff: Re: [Zope3-Users] Disabling authentication for resources<br><br>[...]<br><br>
I guess bypass the authentication process is not supported for<br>zope.Public protected objects.<br><br>Zope does authenticate the user. And later it checks security<br>for the object based on that user (authorization).<br>
<br>zope.Public is correct for public access, but it doesn&#39;t mean<br>the user get not authenticated. Remember authentication and<br>authorization are two different things.<br><br>I&#39;m not really sure. But I guess without authentication,<br>
Zope doesn&#39;t know if even zope.Public is allowed for this<br>user because you can deny permissions. But I&#39;m also not sure<br>without to introspect the code if zope.Public can set as deny.<br><br>Hope that gives some hints for deep into the internals<br>
of IAuthentication. If you need a simpler implementation,<br>take a look at z3c.authenticator.<br><br><br>Regards<br><font color="#888888">Roger Ineichen<br></font>
<div>
<div></div>
<div class="Wj3C7c"><br>&gt;<br>&gt; On Tue, 2008-07-08 at 22:52 -0700, Shailesh Kumar wrote:<br>&gt; &gt; Did you try the resourceDirecotry ZCML directive?<br>&gt; &gt;<br>&gt; &gt; &lt;browser:resourceDirectory<br>&gt; &gt;<br>
&gt; &gt; name=&quot;js&quot;<br>&gt; &gt;<br>&gt; &gt; directory=&quot;resource/js&quot;<br>&gt; &gt;<br>&gt; &gt; layer=&quot;.interfaces.IBatonSkin&quot;<br>&gt; &gt;<br>&gt; &gt; /&gt;<br>&gt; &gt; that way they don&#39;t need the authentication overhead.<br>
&gt;<br>&gt; Thanks for the replies, everyone. This is what I currently<br>&gt; have as an example of a resource I&#39;m fetching:<br>&gt;<br>&gt; &nbsp; &lt;resourceDirectory<br>&gt; &nbsp; &nbsp; &nbsp; name=&quot;ajs&quot;<br>&gt; &nbsp; &nbsp; &nbsp; directory=&quot;ajs&quot;<br>
&gt; &nbsp; &nbsp; &nbsp; layer=&quot;vortex.layer.IVortexBrowserLayer&quot;<br>&gt; &nbsp; &nbsp; &nbsp; permission=&quot;zope.Public&quot;<br>&gt; &nbsp; &nbsp; &nbsp; /&gt;<br>&gt;<br>&gt; But if I try to access one of these resources directly from the web,<br>&gt; e.g.:<br>
&gt;<br>&gt; http://.../@@/ajs/gb_styles.css<br>&gt;<br>&gt; I still get my authentication code being called. I&#39;ve tracked<br>&gt; it down this far:<br>&gt;<br>&gt; (zope.app.publication:<a href="http://zope.publication.py/" target="_blank">zope.publication.py</a>)<br>
&gt;<br>&gt; &nbsp; &nbsp; def _maybePlacefullyAuthenticate(self, request, ob):<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; if not<br>&gt; IUnauthenticatedPrincipal.providedBy(request.principal):<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # We&#39;ve already got an authenticated user.<br>
&gt; There&#39;s nothing to do.<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # Note that beforeTraversal guarentees that user<br>&gt; is not None.<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return<br>&gt;<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; if not ISite.providedBy(ob):<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # We won&#39;t find an authentication utility here,<br>
&gt; so give up.<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return<br>&gt;<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; sm = removeSecurityProxy(ob).getSiteManager()<br>&gt;<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; auth = sm.queryUtility(IAuthentication)<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; if auth is None:<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # No auth utility here<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return<br>&gt;<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; # Try to authenticate against the auth utility<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; principal = auth.authenticate(request) &nbsp; &nbsp;&lt;!----- My<br>&gt; PAU called<br>&gt; here<br>&gt;<br>&gt; Any ideas ?<br>
&gt;<br>&gt; Cheers, Andrew.<br>&gt;<br><br>_______________________________________________<br>Zope3-users mailing list<br><a href="mailto:Zope3-users@zope.org">Zope3-users@zope.org</a><br><a href="http://mail.zope.org/mailman/listinfo/zope3-users" target="_blank">http://mail.zope.org/mailman/listinfo/zope3-users</a><br>
</div></div></blockquote></div><br>