[Checkins] SVN: Products.CMF - Prevent ZMI content creation by hiding the add list entry instead of

Jens Vagelpohl jens at dataflake.org
Sat Sep 13 12:12:38 EDT 2008


Log message for revision 91118:
  - Prevent ZMI content creation by hiding the add list entry instead of
    not registering the products at all. Not calling ContentInit at all
    may break older FactoryTypeInformation and ScriptableTypeInformations.
  

Changed:
  U   Products.CMFCalendar/trunk/Products/CMFCalendar/CHANGES.txt
  U   Products.CMFCalendar/trunk/Products/CMFCalendar/__init__.py
  U   Products.CMFCore/trunk/Products/CMFCore/CHANGES.txt
  U   Products.CMFCore/trunk/Products/CMFCore/__init__.py
  U   Products.CMFDefault/trunk/Products/CMFDefault/CHANGES.txt
  U   Products.CMFDefault/trunk/Products/CMFDefault/__init__.py
  U   Products.CMFTopic/trunk/Products/CMFTopic/CHANGES.txt
  U   Products.CMFTopic/trunk/Products/CMFTopic/__init__.py

-=-
Modified: Products.CMFCalendar/trunk/Products/CMFCalendar/CHANGES.txt
===================================================================
--- Products.CMFCalendar/trunk/Products/CMFCalendar/CHANGES.txt	2008-09-13 13:54:24 UTC (rev 91117)
+++ Products.CMFCalendar/trunk/Products/CMFCalendar/CHANGES.txt	2008-09-13 16:12:38 UTC (rev 91118)
@@ -4,8 +4,8 @@
 2.2.0 (unreleased)
 ------------------
 
-- ZMI: Removed the ability to create content from the ZMI. It was never
-  fully supported and carried the risk of creating half-formed content.
+- ZMI: Prevent users from creating content through the ZMI by hiding the
+  entry for "CMFCalendar Content".
 
 - Event: 'addEvent' no longer sends add events.
 

Modified: Products.CMFCalendar/trunk/Products/CMFCalendar/__init__.py
===================================================================
--- Products.CMFCalendar/trunk/Products/CMFCalendar/__init__.py	2008-09-13 13:54:24 UTC (rev 91117)
+++ Products.CMFCalendar/trunk/Products/CMFCalendar/__init__.py	2008-09-13 16:12:38 UTC (rev 91118)
@@ -15,6 +15,7 @@
 $Id$
 """
 
+from Products.CMFCore.utils import ContentInit
 from Products.CMFCore.utils import ToolInit
 
 import Event
@@ -31,3 +32,11 @@
             , tools=(CalendarTool.CalendarTool,)
             , icon='tool.gif'
             ).initialize( context )
+
+    # BBB: register oldstyle constructors
+    ContentInit( 'CMF Calendar Content'
+               , content_types=()
+               , permission=AddPortalContent
+               , extra_constructors=(Event.addEvent,)
+               , visibility=None
+               ).initialize( context )

Modified: Products.CMFCore/trunk/Products/CMFCore/CHANGES.txt
===================================================================
--- Products.CMFCore/trunk/Products/CMFCore/CHANGES.txt	2008-09-13 13:54:24 UTC (rev 91117)
+++ Products.CMFCore/trunk/Products/CMFCore/CHANGES.txt	2008-09-13 16:12:38 UTC (rev 91118)
@@ -4,9 +4,13 @@
 2.2.0 (unreleased)
 ------------------
 
-- ZMI: Removed the ability to create content from the ZMI. It was never
-  fully supported and carried the risk of creating half-formed content.
+- ZMI: Prevent users from creating content through the ZMI by hiding the
+  entry for "CMFCore Content".
 
+- utils: Add a new optional argument to ContentInit that allows hiding
+  a content item's ZMI add list entry. The default is to leave the item
+  visible, which reflects the previous behavior.
+
 - FSMetadata: Remove handling of .security and .properties metadata
   files which was supposed to have been removed in CMF 2.0 already.
 

Modified: Products.CMFCore/trunk/Products/CMFCore/__init__.py
===================================================================
--- Products.CMFCore/trunk/Products/CMFCore/__init__.py	2008-09-13 13:54:24 UTC (rev 91117)
+++ Products.CMFCore/trunk/Products/CMFCore/__init__.py	2008-09-13 16:12:38 UTC (rev 91118)
@@ -126,6 +126,14 @@
                   , icon='tool.gif'
                   ).initialize( context )
 
+    # BBB: register oldstyle constructors
+    utils.ContentInit( 'CMF Core Content'
+                     , content_types=()
+                     , permission=AddPortalFolders
+                     , extra_constructors=_EXTRA_CONSTRUCTORS
+                     , visibility=None
+                     ).initialize( context )
+
     # make registerHelp work with 2 directories
     help = context.getProductHelp()
     lastRegistered = help.lastRegistered

Modified: Products.CMFDefault/trunk/Products/CMFDefault/CHANGES.txt
===================================================================
--- Products.CMFDefault/trunk/Products/CMFDefault/CHANGES.txt	2008-09-13 13:54:24 UTC (rev 91117)
+++ Products.CMFDefault/trunk/Products/CMFDefault/CHANGES.txt	2008-09-13 16:12:38 UTC (rev 91118)
@@ -4,8 +4,8 @@
 2.2.0 (unreleased)
 ------------------
 
-- ZMI: Removed the ability to create content from the ZMI. It was never
-  fully supported and carried the risk of creating half-formed content.
+- ZMI: Prevent users from creating content through the ZMI by hiding the
+  entry for "CMFDefault Content".
 
 - SyndicationTool: Removed obsolete documentation link from the
   Overview ZMI tab.

Modified: Products.CMFDefault/trunk/Products/CMFDefault/__init__.py
===================================================================
--- Products.CMFDefault/trunk/Products/CMFDefault/__init__.py	2008-09-13 13:54:24 UTC (rev 91117)
+++ Products.CMFDefault/trunk/Products/CMFDefault/__init__.py	2008-09-13 16:12:38 UTC (rev 91118)
@@ -16,6 +16,7 @@
 """
 
 from Products.CMFCore.utils import ToolInit
+from Products.CMFCore.utils import ContentInit
 from Products.CMFCore.utils import registerIcon
 
 import DefaultWorkflow
@@ -74,6 +75,14 @@
             , icon='tool.gif'
             ).initialize( context )
 
+    # BBB: register oldstyle constructors
+    ContentInit( 'CMF Default Content'
+               , content_types=()
+               , permission=AddPortalContent
+               , extra_constructors=contentConstructors
+               , visibility=None
+               ).initialize( context )
+
     context.registerClass( Portal.CMFSite
                          , constructors=(factory.addConfiguredSiteForm,
                                          factory.addConfiguredSite)

Modified: Products.CMFTopic/trunk/Products/CMFTopic/CHANGES.txt
===================================================================
--- Products.CMFTopic/trunk/Products/CMFTopic/CHANGES.txt	2008-09-13 13:54:24 UTC (rev 91117)
+++ Products.CMFTopic/trunk/Products/CMFTopic/CHANGES.txt	2008-09-13 16:12:38 UTC (rev 91118)
@@ -4,8 +4,8 @@
 2.2.0 (unreleased)
 ------------------
 
-- ZMI: Removed the ability to create content from the ZMI. It was never
-  fully supported and carried the risk of creating half-formed content.
+- ZMI: Prevent users from creating content through the ZMI by hiding the
+  entry for "CMFTopic Content".
 
 - unit tests: Add a functional testing layer for CMFTopic, and use it.
 

Modified: Products.CMFTopic/trunk/Products/CMFTopic/__init__.py
===================================================================
--- Products.CMFTopic/trunk/Products/CMFTopic/__init__.py	2008-09-13 13:54:24 UTC (rev 91117)
+++ Products.CMFTopic/trunk/Products/CMFTopic/__init__.py	2008-09-13 16:12:38 UTC (rev 91118)
@@ -15,6 +15,8 @@
 $Id$
 """
 
+from Products.CMFCore.utils import ContentInit
+
 import Topic
 from permissions import AddTopics
 
@@ -30,3 +32,11 @@
 
     context.registerHelpTitle( 'CMF Topic Help' )
     context.registerHelp( directory='help' )
+
+    # BBB: register oldstyle constructors
+    ContentInit( 'CMF Topic Content'
+               , content_types=()
+               , permission=AddTopics
+               , extra_constructors=(Topic.addTopic,)
+               , visibility=None
+               ).initialize( context )



More information about the Checkins mailing list