[Zope-dev] preventing acquisition
Michel Pelletier
michel@digicool.com
Sun, 01 Aug 1999 05:26:55 -0400
Robin Becker wrote:
>
> I have found acquisition useful in several cases, but I would like to
> eliminate it for certain folders
>
> I have
>
> /-index_html
> |
> |--DOCS/
> |
> |--IMAGES/
> |
> |--RUBBISH/
>
> it's useful in DOCS/mydoc_html to refer to IMAGES/myimage.gif, but I
> really don't want RUBBISH/index_html to be available as /DOCS/RUBBISH
>
> Do I have to go through a whole rigmarole of defining roles/users or is
> there some easy way to make RUBBISH non-acquirable?
> --
The index_html method in R could check the roles of the user, and raise
NotFound if you weren't happy about user seeing RUBBISH/. Any
combination of DTML check could be made before you did a <dtml-raise
NotFound><dtml-zippy></dtml-raise>. The Zippy tag filling in for an
inciteful error message in this case.
For example (and I actualy checked this, usualy I just make it up):
<dtml-var standard_html_header>
<dtml-if "'Anonymous' in AUTHENTICATED_USER.getRoles()">
<dtml-raise NotFound>
<h2>Your not supposed to be looking at
<dtml-var "absolute_url()"> </h2>
</dtml-raise>
</dtml-if>
<h2><!--#var title_or_id--></h2>
<p>
This is the <!--#var id--> Document.
</p>
<dtml-var standard_html_footer>
-Michel
> Robin Becker
>
> _______________________________________________
> Zope-Dev maillist - Zope-Dev@zope.org
> http://www.zope.org/mailman/listinfo/zope-dev
>
> (To receive general Zope announcements, see:
> http://www.zope.org/mailman/listinfo/zope-announce
>
> For non-developer, user-level issues,
> zope@zope.org, http://www.zope.org/mailman/listinfo/zope )