browser:menu and viewlets have this behavior out the box, viewlet are more component I think.<br>
<br>
But often you need more custom decisions, then you have zope.security.canAccess or other zope.security API methods.<br><br>
This is example from code which iterates on contained objects and it shows a links in these contexts (i.e. forums):<br>
<br>
adminLinks = getMultiAdapter((self.context, self.request, self), IContentProvider, name='links')<br>
...<br>
for forum in self.context.values():<br>
...<br>
yield {...<br>
'adminLinks': zope.security.canAccess(adminLinks, 'render') and adminLinks.render(forum) or u''<br>
}<br><br>These IContentProvider adapters are declared in zcml with permissions and `locate="True"`. Then that links displayed when defined permission allowed on the a forum.<br> <br><div class="gmail_quote">2010/7/25 Justin Ryan <span dir="ltr"><<a href="mailto:justin.ryan@reliefgarden.org">justin.ryan@reliefgarden.org</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hiya..<div><br></div><div>I want to restrict some links to display only for principals with access to the link target, e.g. an add, edit, admin page, based on permissions.</div>
<div><br></div><div>For the life of me, I can't find an example of this.. Any pointers would be helpful.</div>
<br>_______________________________________________<br>
bluebream mailing list<br>
<a href="mailto:bluebream@zope.org">bluebream@zope.org</a><br>
<a href="https://mail.zope.org/mailman/listinfo/bluebream" target="_blank">https://mail.zope.org/mailman/listinfo/bluebream</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Ilshad R. Khabibullin<br><a href="http://astoon.zwiki.org">http://astoon.zwiki.org</a><br>+7 922 600 56 06<br>