[Zope-CMF] limit allowed content type per folder

Dieter Maurer dieter@handshake.de
Sat, 24 May 2003 22:05:29 +0200


Rob Boyd wrote at 2003-5-23 11:07 -0700:
 > I have a custom SkinnedFolder content type that I use
 > four of - one called news, one called documents, one
 > called files, one called forums.  Each SkinnedFolder
 > (called a ToolBox) has a property of tool_type, by
 > which I specify what that ToolBox is intended to
 > contain.  How would I limit a particular ToolBox's
 > allowed content type to whatever its tool_type is?  In
 > factory_type_information, I list all four content
 > types in allowed_content_types.  Other than modifying
 > the folder_contents template, is there a way to have
 > an instance of a content type have a subset of the
 > class's allowed types so that a user could only add
 > the proper content to a given folder?

I think it is not a good idea at all to use the standard
creation way for your special objects.

I would prohibit object creation in these folders althogether
for non-priviledge users. I would provide actions
"add news", "add document", ... They call a specialized
factory (with the right proxie role) that knows where to place
the objects of various types.


Dieter