[Zope] strange ZClass method problem

Didier Georgieff dgieff@divinerites.com
8 Dec 2000 18:11:11 +0100


Hello,

* I have 2 Folders (Yihaw ZClass instances)
* both folders have News objects (cataloged)

I put the news on the front page via (this is taken from Yihaw, simplified for the 
demonstation, but still have the problem) this code

<dtml-in "Catalog(
  meta_type='Yihaw News Item',
  sort_on='bobobase_modification_time',
  sort_order='reverse')" size=30 start=query_start>

<dtml-with "Catalog.getobject(data_record_id_)">
 <dtml-var absolute_url html_quote> - 
 <dtml-var title_or_id html_quote><br>
</dtml-with>

</dtml-in>

Problem is that some news items are OK and some raise an exeption on <dtml-var 
title_or_id> told to be missing (!!??)

It puzzle me because all news items are same ZClass instance and can be accesed 
normally via the zope interface, or directly, works well on view etc ...

An other strange thing is when i supress the <html_quote> option, an authentication 
windows show up and gives an other traceback (see below).

So when i put the <missing> option, to the <dtml-var title_or_id> it works well except 
nothing shows on the  <dtml-var title_or_id>, and the right <absolute_url> is correctly 
shown for ALL the news item (including the b"bad" ones.

In the context of both Yihaw Folder i have access content, view authorisation and view 
(via a local role).

Only difference is :
* in the folder with problem
access content, view authorisation, view are given by hand at this level (without 
permission acquisition for those 3 for anonymous restriction)
* in the folder without problem
it's acquired from above (no anonymoiyus restriction)

It happens even when i'm "manager".

So i suspect some strange security problem, or more sure something i didn't 
understood on the acquisition/security machinery.
And I'm not sure if it has relation with the fact those items are custom ZClass instances

I hope this was clear and not too cryptic.

The 2 traceback :

1- WITHOUT html_quote

Unauthorized
You are not authorized to access title_or_id. 
Traceback (innermost last):
  File /zope/2-2-2/lib/python/ZPublisher/Publish.py, line 222, 
in publish_module
  File /zope/2-2-2/lib/python/ZPublisher/Publish.py, line 187, 
in publish
  File /zope/2-2-2/lib/python/ZPublisher/Publish.py, line 171, 
in publish
  File /zope/2-2-2/lib/python/ZPublisher/mapply.py, line 160, 
in mapply
    (Object: yihaw_test1)
  File /zope/2-2-2/lib/python/ZPublisher/Publish.py, line 112, 
in call_object
    (Object: yihaw_test1)
  File /zope/2-2-2/lib/python/OFS/DTMLMethod.py, line 172, in 
__call__
    (Object: yihaw_test1)
  File /zope/2-2-2/lib/python/DocumentTemplate/DT_String.py, 
line 528, in __call__
    (Object: yihaw_test1)
  File /zope/2-2-2/lib/python/DocumentTemplate/DT_In.py, line 
611, in renderwb
    (Object: Catalog(meta_type='Yihaw News Item',
  sort_on='bobobase_modification_time',
  sort_order='reverse'))
  File /zope/2-2-2/lib/python/DocumentTemplate/DT_With.py, 
line 146, in render
    (Object: Catalog.getobject(data_record_id_))
  File /zope/2-2-2/lib/python/OFS/DTMLMethod.py, line 194, in 
validate
    (Object: yihaw_test1)
  File /zope/2-2-
2/lib/python/AccessControl/SecurityManager.py, line 139, in 
validate
  File /zope/2-2-
2/lib/python/AccessControl/ZopeSecurityPolicy.py, line 209, in 
validate
Unauthorized: (see above)


2 - WITH html_quote
KeyError
Sorry, a Zope error occurred.

Traceback (innermost last):
  File /zope/2-2-2/lib/python/ZPublisher/Publish.py, line 222, 
in publish_module
  File /zope/2-2-2/lib/python/ZPublisher/Publish.py, line 187, 
in publish
  File /zope/2-2-2/lib/python/Zope/__init__.py, line 221, in 
zpublisher_exception_hook
    (Object: ApplicationDefaultPermissions)
  File /zope/2-2-2/lib/python/ZPublisher/Publish.py, line 171, 
in publish
  File /zope/2-2-2/lib/python/ZPublisher/mapply.py, line 160, 
in mapply
    (Object: yihaw_test1)
  File /zope/2-2-2/lib/python/ZPublisher/Publish.py, line 112, 
in call_object
    (Object: yihaw_test1)
  File /zope/2-2-2/lib/python/OFS/DTMLMethod.py, line 172, in 
__call__
    (Object: yihaw_test1)
  File /zope/2-2-2/lib/python/DocumentTemplate/DT_String.py, 
line 528, in __call__
    (Object: yihaw_test1)
  File /zope/2-2-2/lib/python/DocumentTemplate/DT_In.py, line 
611, in renderwb
    (Object: Catalog(meta_type='Yihaw News Item',
  sort_on='bobobase_modification_time',
  sort_order='reverse'))
  File /zope/2-2-2/lib/python/DocumentTemplate/DT_With.py, 
line 146, in render
    (Object: Catalog.getobject(data_record_id_))
  File /zope/2-2-2/lib/python/DocumentTemplate/DT_Var.py, line 
276, in render
    (Object: title_or_id)
KeyError: title_or_id

--
Didier Georgieff
DDAF du Bas-Rhin - Cellule SIG 
2, rue des Mineurs 67070 Strasbourg Cedex
tél : 03.88.25.20.33 - fax : 03.88.25.20.01
email : didier.georgieff@agriculture.gouv.fr
SIT du Bas-Rhin : http://www.bas-rhin.sit.gouv.fr
GéoWeb http://sertit10.u-strasbg.fr