[CMF-checkins] CVS: CMF/CMFCore - PortalFolder.py:1.32

Tres Seaver tseaver@zope.com
Sun, 17 Mar 2002 20:46:42 -0500


Update of /cvs-repository/CMF/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv23707/CMFCore

Modified Files:
	PortalFolder.py 
Log Message:

  - Made 'PortalFolder.invokeFactory' enforce the 'filter_content_types'
    property of the folder's type information object.


=== CMF/CMFCore/PortalFolder.py 1.31 => 1.32 ===
         return None
 
+    def reindexObject( self ):
+        """
+            Make content-assuming factory mechanism happy.
+        """
+        pass
+
     def PUT_factory( self, name, typ, body ):
         """
             Dispatcher for PUT requests to non-existent IDs.  Returns
@@ -325,6 +331,12 @@
         Invokes the portal_types tool.
         '''
         pt = getToolByName( self, 'portal_types' )
+        myType = pt.getTypeInfo(self)
+
+        if myType is not None:
+            if not myType.allowType( type_name ):
+                raise ValueError, 'Disallowed suboject type: %s' % type_name
+
         apply( pt.constructContent
              , (type_name, self, id, RESPONSE) + args
              , kw