> Re: [Zope-CMF] Registering content types with different add permissions in one module Re: [Zope-CMF] Registering content types with different add permissions in one module

Heimo Laukkanen huima at iki.fi
Tue Oct 21 11:16:10 EDT 2003


> Seb Bacon wrote:
> 
>> One quick answer is: don't use utils.ContentInit to register the exception(s).
 >  You should just use the standard product registration mechanism[1].
 >This means you won't be able to add the type through the CMFDefault
 >Product, etc, but it will work.

  What do you mean with won't be able to add trhough the CMFDefault 
Products?

  I noticed that in NeoPortal and NeoPortalContentPack the initialization
worked in the way that I tried to do it. Below is a snip from
NeoportalContentPacks __init.py

  utils.ContentInit( 'NeoPortal Content Pak'
                       , content_types=contentClasses
                       , permission=AddPortalContent
                       , extra_constructors=contentConstructors
                       , 
fti=(factory_type_information+advanced_factory_type_information)
                       ).initialize( context )

      utils.ContentInit( 'NeoPortal Advanced Content Pak'
                       , content_types=advancedContentClasses
                       , permission=ManagePortal
                       , extra_constructors=advancedContentConstructors
                       , 
fti=(factory_type_information+advanced_factory_type_information)
                       ).initialize( context )

But I haven't studied how the class registrations as a whole works
and don't have a clue on why it did not work.

  -huima





More information about the Zope-CMF mailing list