[Zope] Re: PythonMethods and import

Evan Simpson evan@tokenexchange.com
Thu, 9 Sep 1999 08:26:16 -0500


----- Original Message -----
From: Jay, Dylan <djay@lucent.com>
> Python methods look really nice however why remove the use of import. I
> guess this is a security hazard and allows access to the filesystem but it
> also allows the use of many very usefull packages that to use mean the
> messyness of creating external methods.

Funny you should mention that! <wink>.  I have a version for my personal use
with unlimited import enabled for just this reason.  I'm considering giving
PythonMethods a permission (given to *no one* by default) which would allow
this feature.  That said, I'm not 100% sure exactly how import will work in
the general case.  Right now, I'm tentatively thinking of having a magical
root 'package' called Zope, with which you could write:

from Zope.folder1.folder2 import doc1

to get doc1 from folder2 from folder1 in the root of the ZODB, while only
privileged users could perform a bare 'import frotz' to access 'real'
packages and modules.

Sound good?