[Zope] authentication probelm (take two)

Bob Shelton polaris@infinity.erf.net
Thu, 12 Jul 2001 04:15:22 -0500


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)">
      &nbsp;&nbsp;
    </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