[Zope] TAL - authentication

Dieter Maurer dieter@handshake.de
Wed, 13 Feb 2002 19:54:39 +0100


Tom Nixon writes:
 > I want to have a <span> with a tal:condition clause that means it's only
 > displayed if there is an authenticated user logged in, or alternatively
 > if the user has particular privileges. In DTML it would be something
 > like the following but I'm not sure about how to do it in TAL.
 > 
 > <dtml-if expr="_.SecurityCheckPermission('Add Documents, Images, and
 > Files', this())">
 >  Hello authorised user
 > </dtml-if>
 > 
 > I assume something like this:
 > <span tal:condition="python:someSecurityFunction()"
 > tal:replace="string:Hello authorised user"></span>
Try:

   tal:condition="SecurityCheckPermission('Add Documents, Images, and Files',here)"


Dieter