[Zope] DTML Document class Id bug, somewhat fixed. But now setName ...

Walter A. Aprile Walter A. Aprile" <walter@ilce.edu.mx
Thu, 29 Jun 2000 11:33:08 -0500 (CDT)


Hi,
	I had (have) a problem with the Id property on an Article class that
subclasses the DTML document.

	And indeed the problem was with the fact that I was subclassing the
DTML Document, which as explained in http://www.zope.org/Members/AlexR/ZClassIDBug
somewhat mangles the Id property. Public thanks to Rik Hoekstra <rik.hoekstra@inghist.nl>
for suggesting that. 
	I added this fix (from the page I mention above) to the constructor method,

<!--#with "myZClass.createInObjectManager(REQUEST['id'], REQUEST)"-->
            <dtml-call "setName(REQUEST['id'])">
<!--#/with-->

And when I try creating a new object, it blows up in my face with this
error:

Unauthorized

  You are not authorized to access setName. 

  Traceback (innermost last):
    File /usr/local/zope/lib/python/ZPublisher/Publish.py, line 214, in publish_module
    File /usr/local/zope/lib/python/ZPublisher/Publish.py, line 179, in publish
    File /usr/local/zope/lib/python/ZPublisher/Publish.py, line 165, in publish
    File /usr/local/zope/lib/python/ZPublisher/mapply.py, line 160, in mapply
      (Object: ArticleClass_add)
    File /usr/local/zope/lib/python/ZPublisher/Publish.py, line 102, in call_object
      (Object: ArticleClass_add)
    File /usr/local/zope/lib/python/OFS/DTMLMethod.py, line 150, in __call__
      (Object: ArticleClass_add)
    File /usr/local/zope/lib/python/DocumentTemplate/DT_String.py, line 502, in __call__
      (Object: ArticleClass_add)
    File /usr/local/zope/lib/python/DocumentTemplate/DT_With.py, line 148, in render
      (Object: ArticleClass.createInObjectManager(REQUEST['id'], REQUEST))
    File /usr/local/zope/lib/python/DocumentTemplate/DT_Util.py, line 329, in eval
      (Object: setName(REQUEST['id']))
      (Info: setName)
  Unauthorized: (see above)


I _think_ that my user on this system has enough permissions to do this. Should I 
just ditch the class and recreate it (under the hypothesis that I botched something
while I was creating it the first time), or should I pester the guy that made my
user for additional, God-like, power ? And what is so special about setName ?

This is under:
Zope version: Zope 2.1.6 (binary release, python 1.5.2, solaris-2.6-sparc) 
Python version: 1.5.2 (#8, Nov 16 1999, 10:05:41) [GCC 2.8.1] 

Thanks in advance,
			Walter

-- Vita brevis, ars longa, occasio celeris, experimentum periculosum,
judicium difficile. Attention: Un train peut en cacher un autre
-><- Eris aprueba este email ! -><- http://redescolar.ilce.edu.mx