[Zope-CMF] Managing Portal Roles

Dieter Maurer dieter@handshake.de
Wed, 26 Sep 2001 21:35:13 +0200 (CEST)


=?iso-8859-1?Q?Jo=E3o?= Neves writes:
 > I'm working on a form to permit user management similar to what is found
 > in the ZMI (manage_users).
 > I got to a point where I can list the Portal Roles, but nothing I've
 > tried can get the roles a member already has to come up SELECTED. Here
 > is a snippet of the code I'm using:
 > 
 > 'membro' is mapped to the member being edited..
 > 
 > <select name="roles:list" multiple>
 >     <dtml-in "portal_membership.getPortalRoles()">
 >     <option value="<dtml-var sequence-item>"<dtml-if
 > membro.has_role(_['sequence-item'])> SELECTED </dtml-if>><dtml-var
 > sequence-item>
 >     </dtml-in>
 >     </select>

       <dtml-if "membro.has_role(_['sequence-item'])">

Note the quotes! They are essential....

Read, e.g., 

  <http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html>

to understand why....


Dieter