Re: [Zope-CMF] Extending FTI.isConstructionAllowed

2009-06-04 Thread Wichert Akkerman
Previously yuppie wrote: After (re)reading all the comments and having a closer look at the code I came to these conclusions: 1.) CMF 2.1 checks two different restrictions: allowType() and isConstructionAllowed(). PortalFolderBase._verifyObjectPaste just checks allowType() because in CMF

Re: [Zope-CMF] Extending FTI.isConstructionAllowed

2009-06-04 Thread yuppie
Hi Wichert! Wichert Akkerman wrote: Previously yuppie wrote: 2.) The distinction between allowType() and isConstructionAllowed() was clear in CMF 2.1: allowType() checked a cheap, not permission related CMF specific restriction. isConstructionAllowed() checked generic permission related

Re: [Zope-CMF] Extending FTI.isConstructionAllowed

2009-06-03 Thread Charlie Clark
Am 02.06.2009 um 14:47 schrieb Wichert Akkerman: That assumes the object has already been constructed and you're only testing constraints for adding the instance to the container. Our use case is different: we are testing at a point where construction has not happened yet. I think there

Re: [Zope-CMF] Extending FTI.isConstructionAllowed

2009-06-03 Thread Charlie Clark
Am 03.06.2009 um 10:12 schrieb Wichert Akkerman: There are two reasons I want to block creation of the object: performance, and user interface. The last one is more critical: the add-item menus used in Plone (and I suspect CMF as well) look for all object types that can be constructed

Re: [Zope-CMF] Extending FTI.isConstructionAllowed

2009-06-03 Thread yuppie
Hi Wichert! Wichert Akkerman wrote: I have a use case where I need to put additional restrictions on object creation, in particular I need to restrict the maximum depth of items inside of a container of a specific type. The ideal place to put such a restriction seems to be the

Re: [Zope-CMF] Extending FTI.isConstructionAllowed

2009-06-02 Thread Wichert Akkerman
Previously Tres Seaver wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Wichert Akkerman wrote: I have a use case where I need to put additional restrictions on object creation, in particular I need to restrict the maximum depth of items inside of a container of a specific type.

Re: [Zope-CMF] Extending FTI.isConstructionAllowed

2009-06-02 Thread Wichert Akkerman
Previously yuppie wrote: It's no hook for adding restrictions, but it's a hook for using different implementations. and does not support portal types. Do you mean does not support per portal type hooks or do you mean does not support filtering based on portal type name? The latter.

Re: [Zope-CMF] Extending FTI.isConstructionAllowed

2009-06-02 Thread Wichert Akkerman
Previously Wichert Akkerman wrote: I have a use case where I need to put additional restrictions on object creation, in particular I need to restrict the maximum depth of items inside of a container of a specific type. The ideal place to put such a restriction seems to be the

Re: [Zope-CMF] Extending FTI.isConstructionAllowed

2009-06-02 Thread yuppie
Wichert Akkerman wrote: Previously yuppie wrote: A CMF specific precondition would look up type restrictions in the fti of the container. checkFactory and checkObject are quite similar to isConstructionAllowed. I think we should reimplement this based on zope.container before we start

Re: [Zope-CMF] Extending FTI.isConstructionAllowed

2009-06-02 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Wichert Akkerman wrote: Previously Tres Seaver wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Wichert Akkerman wrote: I have a use case where I need to put additional restrictions on object creation, in particular I need to restrict the

[Zope-CMF] Extending FTI.isConstructionAllowed

2009-05-29 Thread Wichert Akkerman
I have a use case where I need to put additional restrictions on object creation, in particular I need to restrict the maximum depth of items inside of a container of a specific type. The ideal place to put such a restriction seems to be the isConstructionAllowed method on the FTI. Currently

Re: [Zope-CMF] Extending FTI.isConstructionAllowed

2009-05-29 Thread yuppie
Wichert Akkerman wrote: I have a use case where I need to put additional restrictions on object creation, in particular I need to restrict the maximum depth of items inside of a container of a specific type. The ideal place to put such a restriction seems to be the isConstructionAllowed

Re: [Zope-CMF] Extending FTI.isConstructionAllowed

2009-05-29 Thread Wichert Akkerman
Previously yuppie wrote: Wichert Akkerman wrote: I have a use case where I need to put additional restrictions on object creation, in particular I need to restrict the maximum depth of items inside of a container of a specific type. The ideal place to put such a restriction seems to be

Re: [Zope-CMF] Extending FTI.isConstructionAllowed

2009-05-29 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Wichert Akkerman wrote: I have a use case where I need to put additional restrictions on object creation, in particular I need to restrict the maximum depth of items inside of a container of a specific type. The ideal place to put such a

Re: [Zope-CMF] Extending FTI.isConstructionAllowed

2009-05-29 Thread yuppie
Wichert Akkerman wrote: Previously yuppie wrote: Wichert Akkerman wrote: I have a use case where I need to put additional restrictions on object creation, in particular I need to restrict the maximum depth of items inside of a container of a specific type. The ideal place to put such a