[Zope] Getting role information

Brad Clements bkc@murkworks.com
Wed, 17 Feb 1999 11:13:48 -0400


On 17 Feb 99, at 16:31, Martijn Faassen wrote:

> I'm trying to write an external method that returns different HTML
> snippets (actually structured text) depending on which role the person
> requesting the page has. The idea is to give different info to the viewer
> if the user happens to be a manager (or some other role) vs anonymous. 
> This way, one could for instance include extra hyperlinks (for example to
> 'manage this page').
> 
> Is something like this possible at all? Perhaps such info isn't sent to
> anonymous pages. And if it's possible, how does one do it?


My standard_html_header has this line

<!--#call "REQUEST.set('isManager',AUTHENTICATED_USER.hasRole(_.None,['Manager']))"-->


My standard_html_footer has this:

<!--#if isManager-->
<br><p align="right" class="HotLink">
  <a class="HotLink" href="<!--#var URL0-->/manage_main">Edit This Page</a>
<!--#endif-->

This is stolen from the www.zope.org site. You can use their dhtml viewer to see pages that 
don't have a "show DHTML" hyperlink on them by typing in the appropriate URL directly.



Brad Clements,                bkc@murkworks.com   (315)268-1000
http://www.murkworks.com                          (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com               ICQ: 14856937