[Zope-dev] Zope

Joerg Wittenberger Joerg Wittenberger <Joerg.Wittenberger@pobox.com>
Tue, 28 Sep 1999 18:45:34 +0200 (CEST)


What's the difference?

I have a task list, which adds a new task with the following simple
dtml method.  The first version gave me some grief, because it happend
to work as superuser, but no longer when I logged into zope as manager
of the page (which is restricted to the manager of the task list).

Code working as superuser only:

<dtml-call "REQUEST.set('id', _.str(_.int(ZopeTime())))">
<dtml-with "manage_clone(task, REQUEST['id'], REQUEST)">
 <dtml-call "propertysheets.manage_changeProperties(REQUEST)">
 <dtml-call "propertysheets.Basic.manage_changeProperties(REQUEST)">
</dtml-with>
<dtml-call "RESPONSE.redirect(URL1 + '/listall')">

To work out what's goin on I removed those calls to propertysheets and
threw in all sorts like <dtml-var id>.  I allways ended up with a
permission problem (zopes reply said), but I doubt.  Now I modified
the code slightly...

Code working as Manager as well:

<dtml-call "REQUEST.set('id', _.str(_.int(ZopeTime())))">
<dtml-call "manage_clone(task, REQUEST['id'], REQUEST)">
<dtml-with "_.getitem(REQUEST['id'], 0)">
 <dtml-call "propertysheets.manage_changeProperties(REQUEST)">
 <dtml-call "propertysheets.Basic.manage_changeProperties(REQUEST)">
</dtml-with>
<dtml-call "RESPONSE.redirect(URL1 + '/listall')">

What's the difference (besides that faliure within the dtml-with won't
remove the cloned object anymore)?

Thanks a lot.

/Jerry

-- 
        You can have it done fast,
        you can have it done cheap,
        and you can have it done well.
        --- But you can only have two of those at once.