[Zope-dev] zope.site.hooks

Fabio Tranchitella kobold at kobold.it
Fri Oct 9 02:18:15 EDT 2009


* 2009-10-07 22:40, Martijn Faassen wrote:
> I think it would be interesting to review zope.component.zcml and see how
> it depends on security, and see whether we cannot make the dependency
> optional too.

I fully agree with this, and the main reason why I use a package like
repoze.zcml is to get rid of the (unnecessary) dependency on zope.security.

The only problem with making the dependency on zope.security optional is
related to the "permission" attribute in the zope.component ZCML
directives, which is a zope.security.zcml.Permission.

All the proxying stuff can be made optional with conditional imports.  I
think the only solution to make zope.security optional without removing the
"permission" attribute is to do something like:

try:
    from zope.security.zcml import Permission
except ImportError:
    from zope.schema import TextLine as Permission

Do anybody else has better ideas?

Thanks,
Fabio


More information about the Zope-Dev mailing list