[Zope] Re: Zope External Editor for other folderish containers

Jim Washington jwashin@vt.edu
Fri, 24 May 2002 17:16:12 -0400


I wrote:

> (...)  Now I am trying to figure out why I get Attribute Error when I 
> click to ExternalEdit an object inside a ZClass. Yippee!

Found it. ExternalEditor Class:

    def index_html(self, REQUEST, RESPONSE):
        """Publish the object to the external editor helper app"""

        security = getSecurityManager()
#previously-used line
        #ob = getattr(self.aq_parent, REQUEST['target'])
#this works
        parent = self.aq_parent
        try:
            ob = parent[REQUEST['target']]
        except AttributeError:
            ob = parent.propertysheets.methods[REQUEST['target']]
#end new code
        if not security.checkPermission('View management screen', ob):
            raise 'Unauthorized'
        ...

It works inside ZClasses, on ZClasses/FindTab, and everywhere else I 
have looked.

-- Jim Washington