Réf. : Re: [Zope-CMF] [HELP] Use of "portal_metadata" in a DTML file
Hello Tres,
If you would, please try the attached patch and see if it helps. Thanks a lot for your help : i don't really understand how it work... but it works !! I'll put this bug into the tracker ASAP.
But there's a another little problem : the "MetaDataTool.py" with your patch doesn't still works with the ZMI.
Votre anglais est tres superieur de mon francais. :) Not so bad ! ;-)
Thanks. Fred. Tres Seaver <tseaver@zope.com> 22/04/2002 16:27 Pour : flemaitre@fede.generali.fr cc : Zope-CMF@zope.org, zope@zope.org Objet : Re: [Zope-CMF] [HELP] Use of "portal_metadata" in a DTML file On Mon, 2002-04-22 at 09:56, flemaitre@fede.generali.fr wrote:
Hello,
I'm using the tool "portal_metadata" in order to fix a policy of metadata for my site. But i have a problem : - I'm making a DTML form wich allow my users to modify the Elements of the "portal_metadata" instance - In this DTML form, i get the list of metadata elements by using : "portal_metada.listElementSpecs()" ==> Ok - I want to access (and to modify) the detail of these elements by using : * portal_metadata.getElementSpec(element='My metadata').isRequired() * portal_metadata.getElementSpec(element='My metadata').isMultiValued() * etc....
==> It doesn't work, Zope says "You are not authorized to access isMultiValued", but i'm "Manager" what does it mean ? From the ZMI, the form "metadataElementPolicies.dtml" (of CMFDefault) does the same thing, and it's work.... Why ?
The ZMI version is a class method, and hence operates as "trusted" code; it doesn't surface the bug you found. The 'getElementSpec' method returns the ElementSpec instance without wrapping it in itself, which means that your DTML method cannot do the security checks properly. If you would, please try the attached patch and see if it helps. Please report this as a bug to the tracker.
Excuse my english.... ;-)
Votre anglais est tres superieur de mon francais. :) Tres. -- =============================================================== Tres Seaver tseaver@zope.com Zope Corporation "Zope Dealers" http://www.zope.com
participants (1)
-
flemaitre@fede.generali.fr