[CMF-checkins] CVS: CMF/CMFCore - TypesTool.py:1.29.8.1

Chris Withers chrisw@nipltd.com
Fri, 8 Feb 2002 13:57:46 -0500


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

Modified Files:
      Tag: ChrisW-GlobalHide_branch
	TypesTool.py 
Log Message:
work in progress.

=== CMF/CMFCore/TypesTool.py 1.29 => 1.29.8.1 ===
         {'id':'filter_content_types', 'type': 'boolean', 'mode':'w',
          'label':'Filter content types?'},
+        {'id':'global_hide', 'type': 'boolean', 'mode':'w',
+         'label':'Not implicitly allowed?'},
         {'id':'allowed_content_types'
          , 'type': 'multiple selection'
          , 'mode':'w'
@@ -110,6 +112,7 @@
     filter_content_types = 1
     allowed_content_types = ()
     allow_discussion = 0
+    global_hide = 0
     _actions = ()
 
     def __init__(self, id, **kw):
@@ -205,6 +208,13 @@
         # Private because this returns the actual structure.
         return self._actions
 
+    security.declarePublic('globalHide')
+    def globalHide(self):
+        """
+        Should this type be implicitly addable anywhere?
+        """
+        return self.global_hide
+
     security.declarePublic('getActionById')
     def getActionById( self, id, default=_marker ):
         """
@@ -678,6 +688,8 @@
             if container is not None:
                 if not t.isConstructionAllowed(container):
                     continue
+            if t.globalHide():
+                continue
             rval.append(t)
         return rval