[Zope] not elegant

Bill Kerr kerrb@senet.com.au
Tue, 4 Jun 2002 12:40:34 +0930

still getting my head around the namespace issue, use of dtml-with etc.
need to sit down and have a quiet read of a couple of book etc.
in the meantime a friend has successfully hacked this solution to my problem
of automatically setting up a bunch of users with these requirements:
1. users have viewCopy rights (I wish, seems impossible to implement that
aspect because, View Management Right, allows cut, it's not meant to but it
does!! ) in parent folder
2. users have child folder setup in their name
3. users have local role  management rights in their personal folders

 the code below achieves all this but is not elegant
 in the name of elegance, anyone out there want to improve it?
-- Bill Kerr

this (below) works but it require you set up
<dtml-in expr="['user1','user2','xxx']">
and further down in the program
dtml-in expr="[user1,user2,xxx]">
{without the quotes}

far from perfect solution but ive tried everything possible ??

<dtml-var standard_html_header>
<h2><dtml-var title_or_id></h2>

<dtml-in expr="['user1','user2','xxx']">

<dtml-call expr="REQUEST.set('roles',['viewCopy'])">
<dtml-call expr="REQUEST.set('name',_['sequence-item'])">
<dtml-call expr="REQUEST.set('password','change')">
<dtml-call expr="REQUEST.set('confirm','change')">
<dtml-call expr="REQUEST.set('domains',[])">
<dtml-call expr="acl_users.manage_users('Add',REQUEST,RESPONSE)">
<dtml-call expr="manage_addFolder(_['sequence-item'],'')">
The user <dtml-var "_['sequence-item']"> has been added.

<dtml-in expr="[user1,user2,xxx]">
<dtml-with sequence-item>
   <dtml-call expr="manage_addLocalRoles(id,['Manager'])">
<dtml-var standard_html_footer>