[Zope] Re: Zope External Editor for other folderish containers
Casey Duncan
casey@zope.com
Fri, 24 May 2002 17:48:02 -0400
Thanks a lot! I will go ahead and check this in.
-Casey
On Friday 24 May 2002 05:16 pm, Jim Washington wrote:
> I wrote:
>=20
> > (...) Now I am trying to figure out why I get Attribute Error when I=
=20
> > click to ExternalEdit an object inside a ZClass. Yippee!
>=20
> Found it. ExternalEditor Class:
>=20
> def index_html(self, REQUEST, RESPONSE):
> """Publish the object to the external editor helper app"""
>=20
> security =3D getSecurityManager()
> #previously-used line
> #ob =3D getattr(self.aq_parent, REQUEST['target'])
> #this works
> parent =3D self.aq_parent
> try:
> ob =3D parent[REQUEST['target']]
> except AttributeError:
> ob =3D parent.propertysheets.methods[REQUEST['target']]
> #end new code
> if not security.checkPermission('View management screen', ob):
> raise 'Unauthorized'
> ...
>=20
> It works inside ZClasses, on ZClasses/FindTab, and everywhere else I=20
> have looked.
>=20
> -- Jim Washington
>=20
>=20