On Tue, 27 Jun 2000, Jerome Alet wrote:
If I log in as a user I've created in one of the subfolders then my test seems to be wrong (see below).
here's my code which should create an html link to the add form if the logged in user is a manager for the subfolder (e.g. jerome for Courses), or just display the day number if not
---CUT--- <dtml-calendar> <!-- I begin to create a link to the add form if the user is --> <!-- a manager for the subfolder --> <dtml-with URL1> <dtml-if AUTHENTICATED_USER.has_role('manager')"> <a href="manage_addProduct/GenericEvent/GenEvent_addForm?date=<dtml-var date>"><dtml-var "date.dd()"></a> <dtml-else> <dtml-var "date.dd()"> </dtml-if> </dtml-with>
if I replace this with: ---CUT--- <dtml-if "(('Manager' in AUTHENTICATED_USER.getRoles()) or ('manage' in AUTHENTICATED_USER.getRoles()))"> <a href="manage_addProduct/GenericEvent/GenEvent_addForm?date=<dtml-var date>"><dtml-var "date.dd()"></a> <dtml-else> <a href="<dtml-var "linkDate(date)">"><dtml-var "date.dd()"></a> </dtml-if> ---CUT--- then it works fine !!! If I display AUTHENTICATED_USER.getRoles() then when logged in as superuser it returns "('manage',)" and when logged in as jerome in a subfolder (see my previous message) then it returns "['Manager']" Please could someone explain me what's the problem ? I suppose I AM the problem ;-) PS: I run Zope 2.1.6 with patches. thanks in advance. Jerome ALET - alet@unice.fr - http://cortex.unice.fr/~jerome Faculte de Medecine de Nice - http://noe.unice.fr - Tel: 04 93 37 76 30 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE