[Zope] Show Viewable folders
Montagne, Michael
montagne@BOORA.com
Wed, 1 Aug 2001 16:35:35 -0700
I'm trying to display only the folders that a User has viewing rights to.
The following code snippets are my two different attempts that both seem
flawed. I created a user and a role. Only when that user is assigned the
Manager role at the root level will the ifs test true. I'm deselecting
Acquire permission settings and checking view for the role. I know this is
working because I can view the folder. I tested this by unchecking View and
relying on Acquisition. When I did this, I could not view the folder, just
as it should be. So it seems something in these code snippets is screwy.
What could it be?
<dtml-in expr="PARENTS[0].objectValues('Folder')">
<dtml-if "AUTHENTICATED_USER.has_permission('View','<dtml-sequence-item>')">
<li><a href="<dtml-var absolute_url>"><dtml-var title_or_id></a>
<dtml-else>
Nope<br>
</dtml-if>
</dtml-in>
<dtml-in expr="PARENTS[0].objectValues('Folder')">
<dtml-if expr="_.SecurityCheckPermission('View','<dtml-sequence-item>')">
<li><a href="<dtml-var absolute_url>"><dtml-var title_or_id></a>
<dtml-else>
Nope<br>
</dtml-if>
</dtml-in>