[CMF-checkins] CVS: CMF/CMFCollector - permissions.py:1.2 Collector.py:1.41 CollectorIssue.py:1.53 CollectorPermissions.py:1.5 CollectorSubset.py:1.6 WebTextDocument.py:1.10 __init__.py:1.9

Tres Seaver tseaver at zope.com
Thu Apr 29 12:13:47 EDT 2004


Update of /cvs-repository/CMF/CMFCollector
In directory cvs.zope.org:/tmp/cvs-serv25166/CMFCollector

Modified Files:
	Collector.py CollectorIssue.py CollectorPermissions.py 
	CollectorSubset.py WebTextDocument.py __init__.py 
Added Files:
	permissions.py 
Log Message:
 - Merge tseaver-permissiongeddon-branch.


=== CMF/CMFCollector/permissions.py 1.1 => 1.2 ===
--- /dev/null	Thu Apr 29 12:13:47 2004
+++ CMF/CMFCollector/permissions.py	Thu Apr 29 12:13:16 2004
@@ -0,0 +1,39 @@
+""" CMFCollector product permissions
+
+$Id$
+"""
+from AccessControl import ModuleSecurityInfo
+from Products.CMFCore.permissions import setDefaultRoles
+
+security = ModuleSecurityInfo('Products.CMFCollector.permissions')
+
+security.declarePublic('View')
+from Products.CMFCore.permissions import View
+
+security.declarePublic('ViewCollector')
+ViewCollector = View
+
+security.declarePublic('ViewCollector')
+AddCollector = 'Add portal collector'
+setDefaultRoles(AddCollector, ('Manager', 'Owner'))
+
+security.declarePublic('ManageCollector')
+ManageCollector = 'Add portal collector'
+setDefaultRoles(ManageCollector, ('Manager', 'Owner'))
+
+security.declarePublic('AddCollectorIssue')
+AddCollectorIssue = 'Add collector issue'
+setDefaultRoles(AddCollectorIssue,
+                ('Anonymous', 'Manager', 'Reviewer', 'Owner'))
+
+security.declarePublic('AddCollectorIssueFollowup')
+AddCollectorIssueFollowup = 'Add collector issue comment'
+setDefaultRoles(AddCollectorIssueFollowup, ('Manager', 'Reviewer', 'Owner'))
+
+security.declarePublic('EditCollectorIssue')
+EditCollectorIssue = 'Edit collector issue'
+setDefaultRoles(EditCollectorIssue, ('Manager', 'Reviewer'))
+
+security.declarePublic('SupportIssue')
+SupportIssue = 'Support collector issue'
+setDefaultRoles(SupportIssue, ('Manager', 'Reviewer'))


=== CMF/CMFCollector/Collector.py 1.40 => 1.41 ===
--- CMF/CMFCollector/Collector.py:1.40	Fri May  9 17:40:22 2003
+++ CMF/CMFCollector/Collector.py	Thu Apr 29 12:13:16 2004
@@ -29,9 +29,15 @@
 
 import util
 
-# Import permission names
-from Products.CMFCore import CMFCorePermissions
-from CollectorPermissions import *
+from permissions import View
+from permissions import AddPortalContent
+from permissions import AccessInactivePortalContent
+from permissions import AccessFuturePortalContent
+from permissions import ViewCollector
+from permissions import AddCollectorIssue
+from permissions import EditCollectorIssue
+from permissions import AddCollectorIssueFollowup
+from permissions import ManageCollector
 
 from CollectorIssue import addCollectorIssue, CollectorIssue
 
@@ -162,7 +168,7 @@
         catalog = CollectorCatalog()
         self._setObject(catalog.id, catalog)
 
-    security.declareProtected(CMFCorePermissions.View, 'get_internal_catalog')
+    security.declareProtected(View, 'get_internal_catalog')
     def get_internal_catalog(self):
         """ """
         return self._getOb(INTERNAL_CATALOG_ID)
@@ -385,7 +391,7 @@
                                roles=target_roles,
                                acquire=1)
         # Adjust who can add "attachments":
-        self.manage_permission(CMFCorePermissions.AddPortalContent,
+        self.manage_permission(AddPortalContent,
                                roles=target_roles,
                                acquire=1)
 
@@ -415,7 +421,7 @@
             # and AddPortalContent permissions.
             for m in i.ac_inherited_permissions(1):
                 if m[0] in [AddCollectorIssueFollowup,
-                            CMFCorePermissions.AddPortalContent]:
+                            AddPortalContent]:
                     perm = Permission.Permission(m[0], m[1], i)
                     roles = perm.getRoles()
                     if type(roles) == type(()):
@@ -439,11 +445,11 @@
         got.sort()
         return got
 
-    security.declareProtected(CMFCorePermissions.View, 'Subject')
+    security.declareProtected(View, 'Subject')
     def Subject(self):
         return self.topics
 
-    security.declareProtected(CMFCorePermissions.View, 'length')
+    security.declareProtected(View, 'length')
     def length(self):
         """Use length protocol."""
         return self.__len__()
@@ -543,13 +549,13 @@
     it.manage_permission(AddCollectorIssueFollowup,
                          roles=['Reviewer', 'Manager', 'Owner'],
                          acquire=1)
-    it.manage_permission(CMFCorePermissions.AddPortalContent,
+    it.manage_permission(AddPortalContent,
                          roles=['Reviewer', 'Manager', 'Owner'],
                          acquire=1)
-    it.manage_permission(CMFCorePermissions.AccessInactivePortalContent,
+    it.manage_permission(AccessInactivePortalContent,
                          roles=['Anonymous', 'Reviewer', 'Manager', 'Owner'],
                          acquire=1)
-    it.manage_permission(CMFCorePermissions.AccessFuturePortalContent,
+    it.manage_permission(AccessFuturePortalContent,
                          roles=['Anonymous', 'Reviewer', 'Manager', 'Owner'],
                          acquire=1)
     if REQUEST is not None:


=== CMF/CMFCollector/CollectorIssue.py 1.52 => 1.53 ===
--- CMF/CMFCollector/CollectorIssue.py:1.52	Tue May 27 11:39:09 2003
+++ CMF/CMFCollector/CollectorIssue.py	Thu Apr 29 12:13:16 2004
@@ -14,27 +14,33 @@
 """Implement the Collector Issue content type - a bundle containing the
 collector transcript and various parts."""
 
-import os, urllib, string, re
+import os
+import urllib
+import string
+import re
 import smtplib
 
 from DateTime import DateTime
 from Globals import InitializeClass
-from AccessControl import ClassSecurityInfo, getSecurityManager
+from AccessControl import ClassSecurityInfo
+from AccessControl import getSecurityManager
 from Acquisition import aq_base
 
-import util                             # Collector utilities.
-
-from Products.CMFDefault.DublinCore import DefaultDublinCoreImpl
 from Products.CMFCore.WorkflowCore import WorkflowAction
 from Products.CMFCore.utils import getToolByName
-
+from Products.CMFDefault.DublinCore import DefaultDublinCoreImpl
 from Products.CMFDefault.SkinnedFolder import SkinnedFolder
+
 from WebTextDocument import addWebTextDocument
 
 # Import permission names
-from Products.CMFCore.CMFCorePermissions import View
-from Products.CMFCore.CMFCorePermissions import ModifyPortalContent
-from CollectorPermissions import *
+from permissions import View
+from permissions import ModifyPortalContent
+from permissions import ViewCollector
+from permissions import EditCollectorIssue
+from permissions import AddCollectorIssueFollowup
+
+import util                             # Collector utilities.
 
 RULE = '_' * 40
 


=== CMF/CMFCollector/CollectorPermissions.py 1.4 => 1.5 ===
--- CMF/CMFCollector/CollectorPermissions.py:1.4	Thu Oct 25 15:27:29 2001
+++ CMF/CMFCollector/CollectorPermissions.py	Thu Apr 29 12:13:16 2004
@@ -1,25 +1,12 @@
-from Products.CMFCore import CMFCorePermissions
-from Products.CMFCore.CMFCorePermissions import setDefaultRoles
+""" Backward compatibility;  see Products.CMFCollector.permissions
 
-# Gathering Event Related Permissions into one place
-ViewCollector = CMFCorePermissions.View
-AddCollector = 'Add portal collector'
-ManageCollector = 'Add portal collector'
-AddCollectorIssue = 'Add collector issue'
-AddCollectorIssueFollowup = 'Add collector issue comment'
-EditCollectorIssue = 'Edit collector issue'
-SupportIssue = 'Support collector issue'
+$Id$
+"""
 
-# Set up default roles for permissions
-setDefaultRoles(AddCollector,
-                ('Manager', 'Owner'))
-setDefaultRoles(ManageCollector,
-                ('Manager', 'Owner'))
-setDefaultRoles(AddCollectorIssue,
-                ('Anonymous', 'Manager', 'Reviewer', 'Owner'))
-setDefaultRoles(AddCollectorIssueFollowup,
-                ('Manager', 'Reviewer', 'Owner'))
-setDefaultRoles(EditCollectorIssue,
-                ('Manager', 'Reviewer'))
-setDefaultRoles(SupportIssue,
-                ('Manager', 'Reviewer'))
+from permissions import *
+
+from warnings import warn
+
+warn( "The module, 'Products.CMFCollector.CollectorPermissions' is a "
+      "deprecated compatiblity alias for 'Products.CMFCollector.permissions'; "
+      "please use the new module instead.", DeprecationWarning)


=== CMF/CMFCollector/CollectorSubset.py 1.5 => 1.6 ===
--- CMF/CMFCollector/CollectorSubset.py:1.5	Fri May  9 17:40:22 2003
+++ CMF/CMFCollector/CollectorSubset.py	Thu Apr 29 12:13:16 2004
@@ -1,12 +1,18 @@
-from Products.CMFCore.PortalContent import PortalContent
-from Products.CMFDefault.DublinCore import DefaultDublinCoreImpl
-from Products.CMFCore.CMFCorePermissions import View, ModifyPortalContent
+""" Classes:  CollectorSubset
+
+$Id$
+"""
+from urllib import urlencode
 
 from Acquisition import aq_parent
 from AccessControl import ClassSecurityInfo
 from Globals import InitializeClass
 
-from urllib import urlencode
+from Products.CMFCore.PortalContent import PortalContent
+from Products.CMFDefault.DublinCore import DefaultDublinCoreImpl
+
+from permissions import View
+from permissions import ModifyPortalContent
 
 factory_type_information = \
 ( { 'id'            : 'Collector Subset'


=== CMF/CMFCollector/WebTextDocument.py 1.9 => 1.10 ===
--- CMF/CMFCollector/WebTextDocument.py:1.9	Fri May  9 17:40:22 2003
+++ CMF/CMFCollector/WebTextDocument.py	Thu Apr 29 12:13:16 2004
@@ -23,7 +23,11 @@
 other literal text), without having to know and navigate the nuances of HTML
 and/or structured text."""
 
-import os, urllib, string, re
+import os
+import urllib
+import string
+import re
+
 from Globals import InitializeClass
 from AccessControl import ClassSecurityInfo, getSecurityManager
 from Acquisition import aq_base
@@ -33,8 +37,8 @@
 from Products.CMFDefault.Document import Document
 from Products.CMFDefault.utils import SimpleHTMLParser, bodyfinder
 
-from Products.CMFCore import CMFCorePermissions
-from CollectorPermissions import *
+from permissions import View
+from permissions import ModifyPortalContent
 
 factory_type_information = (
     {'id': 'WebText Document',
@@ -49,13 +53,13 @@
      # XXX May need its own forms, in order to inhibit formatting option.
      'actions': ({'name': 'View',
                   'action': 'string:${object_url}/document_view',
-                  'permissions': (CMFCorePermissions.View,)},
+                  'permissions': (View,)},
                  {'name': 'Edit',
                   'action': 'string:${object_url}/document_edit_form',
-                  'permissions': (CMFCorePermissions.ModifyPortalContent,)},
+                  'permissions': (ModifyPortalContent,)},
                  {'name': 'Metadata',
                   'action': 'string:${object_url}/metadata_edit_form',
-                  'permissions': (CMFCorePermissions.ModifyPortalContent,)},
+                  'permissions': (ModifyPortalContent,)},
                  ),
      },
     )


=== CMF/CMFCollector/__init__.py 1.8 => 1.9 ===
--- CMF/CMFCollector/__init__.py:1.8	Fri May  9 17:40:22 2003
+++ CMF/CMFCollector/__init__.py	Thu Apr 29 12:13:16 2004
@@ -10,16 +10,22 @@
 # FOR A PARTICULAR PURPOSE
 #
 ##############################################################################
+import sys
 
+from Products.CMFCore import utils
+from Products.CMFCore.DirectoryView import registerDirectory
 from Products.CMFDefault import Portal
-import Collector, CollectorIssue, WebTextDocument, CollectorSubset
-import Products.CMFCore
 
-from Products.CMFCore import utils, CMFCorePermissions
-from Products.CMFCore.DirectoryView import registerDirectory
-import CollectorPermissions
+import Collector
+import CollectorIssue
+import WebTextDocument
+import CollectorSubset
+from permissions import View
+from permissions import AddPortalContent
+from permissions import AddCollectorIssue
+from permissions import EditCollectorIssue
+from permissions import AddCollectorIssueFollowup
 
-import sys
 this_module = sys.modules[ __name__ ]
 
 factory_type_information = (
@@ -41,18 +47,18 @@
                { 'id': 'view',
                  'name': 'View',
                  'action': 'string:${object_url}/../',
-                 'permissions': (CMFCorePermissions.View,) },
+                 'permissions': (View,) },
                { 'id': 'addcomment',
                  'name': 'Add Comment',
                  'action':
                      'string:${object_url}/collector_transcript_comment_form',
                  'permissions':
-                          (CollectorPermissions.AddCollectorIssueFollowup,) },
+                          (AddCollectorIssueFollowup,) },
                { 'id': 'edittranscript',
                  'name': 'Edit Transcript',
                  'action':
                         'string:${object_url}/collector_transcript_edit_form',
-                 'permissions': (CollectorPermissions.EditCollectorIssue,) },
+                 'permissions': (EditCollectorIssue,) },
              ),
          },
         )
@@ -80,12 +86,12 @@
 
     context.registerClass(Collector.Collector,
                           constructors = (Collector.addCollector,),
-                          permission = CMFCorePermissions.AddPortalContent)
+                          permission = AddPortalContent)
 
     context.registerClass(CollectorIssue.CollectorIssue,
                           constructors = (CollectorIssue.addCollectorIssue,),
-                          permission = CollectorPermissions.AddCollectorIssue)
+                          permission = AddCollectorIssue)
 
     context.registerClass(CollectorSubset.CollectorSubset,
                           constructors = (CollectorSubset.addCollectorSubset,),
-                          permission = CMFCorePermissions.AddPortalContent)
+                          permission = AddPortalContent)




More information about the CMF-checkins mailing list