[CMF-checkins] CVS: CMF/CMFCollector - Collector.py:1.37

Ken Manheimer klm@zope.com
Thu, 7 Nov 2002 08:00:58 -0500


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

Modified Files:
	Collector.py 
Log Message:
Set permissions to enable non-manager users to add "attachments" (do
file uploads) to issues that they do not own.

(I've only tested the actual permission settings, not yet the
programmatic code to impose the settings, but this closely follows the
settings for AddCollectorIssueFollowup, which i'm imitating.)


=== CMF/CMFCollector/Collector.py 1.36 => 1.37 ===
--- CMF/CMFCollector/Collector.py:1.36	Tue Oct  8 11:50:28 2002
+++ CMF/CMFCollector/Collector.py	Thu Nov  7 08:00:57 2002
@@ -380,9 +380,14 @@
         elif mode == 'anyone':
             target_roles = target_roles + ['Authenticated', 'Anonymous']
 
+        # Adjust who can add followups:
         self.manage_permission(AddCollectorIssueFollowup,
                                roles=target_roles,
                                acquire=1)
+        # Adjust who can add "attachments":
+        self.manage_permission(AddPortalContent,
+                               roles=target_roles,
+                               acquire=1)
 
         self.participation = mode
 
@@ -406,9 +411,10 @@
 
         for i in self.objectValues(spec='CMF Collector Issue'):
 
-            # Ensure the issue acquires AddCollectorIssueFollowup permission.
+            # Ensure the issue acquires AddCollectorIssueFollowup
+            # and AddPortalContent permissions.
             for m in i.ac_inherited_permissions(1):
-                if m[0] == AddCollectorIssueFollowup:
+                if m[0] in [AddCollectorIssueFollowup, AddPortalContent]:
                     perm = Permission.Permission(m[0], m[1], i)
                     roles = perm.getRoles()
                     if type(roles) == type(()):
@@ -534,6 +540,9 @@
                          roles=['Reviewer'],
                          acquire=1)
     it.manage_permission(AddCollectorIssueFollowup,
+                         roles=['Reviewer', 'Manager', 'Owner'],
+                         acquire=1)
+    it.manage_permission(AddPortalContent,
                          roles=['Reviewer', 'Manager', 'Owner'],
                          acquire=1)
     it.manage_permission(CMFCorePermissions.AccessInactivePortalContent,