[Zope] permission and role questions

Michel Pelletier michel@digicool.com
Thu, 15 Apr 1999 11:20:58 -0400


> -----Original Message-----
> From: Rob Page [mailto:rob.page@digicool.com]
> Sent: Thursday, April 15, 1999 11:02 AM
> To: 'Keith Rohrer'
> Cc: 'zope@zope.org'
> Subject: RE: [Zope] permission and role questions
> 
> 
> Keith:
> 
> I can answer some of the more basic questions -- you ask some toughies
> so I'm hopeful others can add some insight.
> 
> >  1) How does one examine the logged-in user's username from 
> >  DTML?  I think I
> >  just need the variable name here...
> 
> <!--#var AUTHENTICATED_USER.getUserName()-->
>   

I hate to call ya out on this one Rob, but 1) in order for the above
DTML to work it must be quoted (because it's an expression) and even the
quoted form:

<!--#var "AUTHENTICATED_USER.getUserName()"-->

is equivilent to:

<!--#var AUTHENTICATED_USER-->

> 
> <UL>
>   <LI><A HREF="PublicRoom">Public Room</A></LI>
> 
>   <!--#if AUTHENTICATED_USER.has_role('Room1Group')-->
>   <LI><A HREF="Room1">Room 1</A></LI>
>   <!--#/if-->
> 
>   <!--#if AUTHENTICATED_USER.has_role('Room2Group')-->
>   <LI><A HREF="Room2">Room 2</A></LI>
>   <!--#/if-->
> 
> </UL>
>   

You will need to quote all of these too.