authentication probelm (take two)
sorry... i accidentally terminated the email message. so, again: i have a python product which inhertis from ObjectManager. i programmatically create instances of this product within itself as they are requested by the user. the problem is that i am getting an 'unauthorized' exception when i try to access index_html of the programmatically created objects. the really odd thing is that it only happens SOMETIMES. i get this: Site Error An error was encountered while publishing this resource. Unauthorized Sorry, a site error occurred. Traceback (innermost last): File /usr/local/src/Zope-2.3.3-src/lib/python/ZPublisher/Publish.py, line 223, in publish_module . . . File /usr/local/src/Zope-2.3.3-src/lib/python/DocumentTemplate/DT_String.py, line 540, in __call__ (Object: forum_top) File /usr/local/src/Zope-2.3.3-src/lib/python/DocumentTemplate/DT_In.py, line 710, in renderwob (Object: getParentForums) Unauthorized: 0 this method seems correct to me: security.declarePublic('getParentForums') def getParentForums(self): "Return a tuple of parent forums." return self._parent_forums it is being called from this dtml file: <center> <h3><dtml-var title_or_id></h3> </center> <p> <dtml-in getParentForums> <dtml-let item=sequence-item index=sequence-index> <a href="&dtml.url-item;"><dtml-var expr="truncateString(item.title_or_id(),45)"></a><br> <dtml-in expr="_.range(index)"> </dtml-in> </dtml-let> </dtml-in> <dtml-var title_or_id> </p> <p> There are <dtml-var getNumberOfMessages> messages. </p> now, this dtml file is created by my product in this manner: DTMLMethod.addDTMLMethod(self,'forum_top','',open(os.path.join(Common.package_home(globals()),'dtml/forum_top.dtml'))) i wanted to do it this way instead of the normal forum_top = DTMLFile('dtml/forum_top',globals()) so the user could modify it using the zope management interface. i also create index_html and a few others in this manner. could this be a culprit in the 'unauthorized' problem? any help would be great! :) i am utterly baffled. -bob
Bob Shelton writes:
File /usr/local/src/Zope-2.3.3-src/lib/python/DocumentTemplate/DT_In.py, line 710, in renderwob (Object: getParentForums) Unauthorized: 0 It appears, there is something strange in your list.
I thinks the "0" what you try to access and are not allowed to, probably because your container has no permission. I suggest, you install Shane's wonderful "ZDebug". Often, it is able to generate excellent diagnostics for permission problems. I think, you need an intermediate DTML object to see the diagnostics. Dieter
participants (2)
-
Bob Shelton -
Dieter Maurer