[Zope] Zope 2.2b2: Adding ZClass Instances Programmatically

Gidon Friedman gidon@friedman.ch
Wed, 28 Jun 2000 19:26:32 +0200


hi

I can't add nested ZClasses in dtml  in 2.2b2 on aix 4.3.
It seems that new security model makes things more
complicated, so if sb could show me the light pls?

the same code worked fine in 2.1.6.  on win95.

thanks a lot

gidon
----------

my calling method:

<dtml-with "manage_addProduct['Surfguide']">
<dtml-call "Stundenplan_add(_.None, _, NoRedir=1)">
</dtml-with>

and in the Stundenplan_add it says:

<dtml-with "Stundenplan.createInObjectManager(REQUEST['id'], REQUEST)">
   <dtml-call "propertysheets.Properties.manage_editProperties(REQUEST)">
   <dtml-with "manage_addProduct['Surfguide']">
      <dtml-call "WTag_add(_.None, _, NoRedir=1, newid='Montag')">

<snip -- some more code and another method to call ---  snip>

i tried proxy roles and Permissions, but i just doesn't seem to
care what permissions i give, it keeps failing:

Traceback (innermost last):
  File /home/gfried/Zope-2.2.0b2-src/lib/python/ZPublisher/Publish.py, line 222, in publish_module
  File /home/gfried/Zope-2.2.0b2-src/lib/python/ZPublisher/Publish.py, line 187, in publish
  File /home/gfried/Zope-2.2.0b2-src/lib/python/ZPublisher/Publish.py, line 171, in publish
  File /home/gfried/Zope-2.2.0b2-src/lib/python/ZPublisher/mapply.py, line 160, in mapply
    (Object: Stundenplan_add)
  File /home/gfried/Zope-2.2.0b2-src/lib/python/ZPublisher/Publish.py, line 112, in call_object
    (Object: Stundenplan_add)
  File /home/gfried/Zope-2.2.0b2-src/lib/python/OFS/DTMLMethod.py, line 167, in __call__
    (Object: Stundenplan_add)
  File /home/gfried/Zope-2.2.0b2-src/lib/python/DocumentTemplate/DT_String.py, line 502, in __call__
    (Object: Stundenplan_add)
  File /home/gfried/Zope-2.2.0b2-src/lib/python/DocumentTemplate/DT_With.py, line 146, in render
    (Object: Stundenplan.createInObjectManager(REQUEST['id'], REQUEST))
  File /home/gfried/Zope-2.2.0b2-src/lib/python/DocumentTemplate/DT_With.py, line 133, in render
    (Object: manage_addProduct['Surfguide'])
  File /home/gfried/Zope-2.2.0b2-src/lib/python/DocumentTemplate/DT_Util.py, line 333, in eval
    (Object: manage_addProduct['Surfguide'])
    (Info: manage_addProduct)
  File &lt;string&gt;, line 0, in ?
  File /home/gfried/Zope-2.2.0b2-src/lib/python/DocumentTemplate/DT_Util.py, line 168, in careful_getitem
  File /home/gfried/Zope-2.2.0b2-src/lib/python/OFS/DTMLMethod.py, line 189, in validate
    (Object: Stundenplan_add)
  File /home/gfried/Zope-2.2.0b2-src/lib/python/AccessControl/SecurityManager.py, line 139, in validate
  File /home/gfried/Zope-2.2.0b2-src/lib/python/AccessControl/ZopeSecurityPolicy.py, line 158, in validate
Unauthorized