[CMF-checkins] CVS: CMF/CMFCalendar - permissions.py:1.2 CalendarTool.py:1.11 Event.py:1.17 EventPermissions.py:1.5 __init__.py:1.5

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


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

Modified Files:
	CalendarTool.py Event.py EventPermissions.py __init__.py 
Added Files:
	permissions.py 
Log Message:
 - Merge tseaver-permissiongeddon-branch.


=== CMF/CMFCalendar/permissions.py 1.1 => 1.2 ===
--- /dev/null	Thu Apr 29 12:13:46 2004
+++ CMF/CMFCalendar/permissions.py	Thu Apr 29 12:13:15 2004
@@ -0,0 +1,41 @@
+##############################################################################
+#
+# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+#
+##############################################################################
+""" CMFCalendar product permissions
+
+$Id$
+"""
+from AccessControl import ModuleSecurityInfo
+
+from Products.CMFCore.permissions import setDefaultRoles
+
+security = ModuleSecurityInfo('Products.CMFCalendar.permissions')
+
+security.declarePublic('AddEvents')
+AddEvents = 'Add portal events'
+setDefaultRoles(AddEvents, ('Manager', 'Owner', 'Member'))
+
+security.declarePublic('ChangeEvents')
+ChangeEvents = 'Change portal events'
+setDefaultRoles(ChangeEvents, ('Manager', 'Owner',))
+
+security.declarePublic('AddPortalContent')
+from Products.CMFCore.permissions import AddPortalContent
+
+security.declarePublic('ManagePortal')
+from Products.CMFCore.permissions import ManagePortal
+
+security.declarePublic('View')
+from Products.CMFCore.permissions import View
+
+security.declarePublic('ModifyPortalContent')
+from Products.CMFCore.permissions import ModifyPortalContent


=== CMF/CMFCalendar/CalendarTool.py 1.10 => 1.11 ===
--- CMF/CMFCalendar/CalendarTool.py:1.10	Sun Jan 11 07:45:35 2004
+++ CMF/CMFCalendar/CalendarTool.py	Thu Apr 29 12:13:15 2004
@@ -24,9 +24,9 @@
 from OFS.SimpleItem import SimpleItem
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 
-from Products.CMFCore.CMFCorePermissions import ManagePortal
 from Products.CMFCore.utils import UniqueObject
 
+from permissions import ManagePortal
 
 class CalendarTool (UniqueObject, SimpleItem):
     """ a calendar tool for encapsualting how calendars work and are displayed """


=== CMF/CMFCalendar/Event.py 1.16 => 1.17 ===
--- CMF/CMFCalendar/Event.py:1.16	Tue Jan 13 05:17:54 2004
+++ CMF/CMFCalendar/Event.py	Thu Apr 29 12:13:15 2004
@@ -20,15 +20,20 @@
 from AccessControl import ClassSecurityInfo
 from webdav.Lockable import ResourceLockedError
 
-from Products.CMFDefault.DublinCore import DefaultDublinCoreImpl
 from Products.CMFCore.PortalContent import PortalContent
 from Products.CMFCore.WorkflowCore import WorkflowAction
-from Products.CMFCore.CMFCorePermissions import View, ModifyPortalContent
-from Products.CMFDefault.utils import formatRFC822Headers, html_headcheck
-from Products.CMFDefault.utils import SimpleHTMLParser, bodyfinder, parseHeadersBody
 from Products.CMFCore.utils import keywordsplitter
 
-import EventPermissions
+from Products.CMFDefault.DublinCore import DefaultDublinCoreImpl
+from Products.CMFDefault.utils import formatRFC822Headers
+from Products.CMFDefault.utils import html_headcheck
+from Products.CMFDefault.utils import SimpleHTMLParser
+from Products.CMFDefault.utils import bodyfinder
+from Products.CMFDefault.utils import parseHeadersBody
+
+from permissions import View
+from permissions import ModifyPortalContent
+from permissions import ChangeEvents
 
 # Factory type information -- makes Events objects play nicely
 # with the Types Tool (portal_types)
@@ -48,7 +53,7 @@
                  {'id': 'edit',
                   'name': 'Edit',
                   'action': 'string:${object_url}/event_edit_form',
-                  'permissions': (EventPermissions.ChangeEvents,)},
+                  'permissions': (ChangeEvents,)},
                  ),                     # End Actions
      },
     )
@@ -172,7 +177,7 @@
         """
         return _dateStrings(self.start())
 
-    security.declareProtected(EventPermissions.ChangeEvents, 'edit')
+    security.declareProtected(ChangeEvents, 'edit')
     def edit(self
              , title=None
              , description=None
@@ -276,14 +281,14 @@
             result.append(str(year))
         return result
 
-    security.declareProtected(EventPermissions.ChangeEvents, 'setStartDate')
+    security.declareProtected(ChangeEvents, 'setStartDate')
     def setStartDate(self, start):
         """
         Setting the event start date, when the event is scheduled to begin.
         """
         self.start_date = self._datify(start)
 
-    security.declareProtected(EventPermissions.ChangeEvents, 'setEndDate')
+    security.declareProtected(ChangeEvents, 'setEndDate')
     def setEndDate(self, end):
         """
         Setting the event end date, when the event ends.


=== CMF/CMFCalendar/EventPermissions.py 1.4 => 1.5 ===
--- CMF/CMFCalendar/EventPermissions.py:1.4	Thu Aug  1 15:05:11 2002
+++ CMF/CMFCalendar/EventPermissions.py	Thu Apr 29 12:13:15 2004
@@ -10,17 +10,15 @@
 # FOR A PARTICULAR PURPOSE
 #
 ##############################################################################
-""" EventPermissions: Permissions used in the CMF Events class
+""" Backward compatibility;  see Products.CMFCalendar.permissions
 
 $Id$
 """
 
-from Products.CMFCore.CMFCorePermissions import setDefaultRoles
+from permissions import *
 
-# Gathering Event Related Permissions into one place
-AddEvents = 'Add portal events'
-ChangeEvents = 'Change portal events'
+from warnings import warn
 
-# Set up default roles for permissions
-setDefaultRoles(AddEvents, ('Manager', 'Owner', 'Member'))
-setDefaultRoles(ChangeEvents, ('Manager', 'Owner',))
+warn( "The module, 'Products.CMFCalendar.EventPermissions' is a deprecated "
+      "compatiblity alias for 'Products.CMFalendar.permissions';  please use "
+      "the new module instead.", DeprecationWarning)


=== CMF/CMFCalendar/__init__.py 1.4 => 1.5 ===
--- CMF/CMFCalendar/__init__.py:1.4	Fri May 10 11:45:47 2002
+++ CMF/CMFCalendar/__init__.py	Thu Apr 29 12:13:15 2004
@@ -10,16 +10,16 @@
 # FOR A PARTICULAR PURPOSE
 # 
 ##############################################################################
-from Products.CMFDefault import Portal
-import Event
-import Products.CMFCore
+import sys
 
-from Products.CMFCore import utils, CMFCorePermissions
+from Products.CMFCore import utils
 from Products.CMFCore.DirectoryView import registerDirectory
-import EventPermissions
+from Products.CMFDefault import Portal
+
+import Event
 import CalendarTool
+from permissions import AddPortalContent
 
-import sys
 this_module = sys.modules[ __name__ ]
 
 contentConstructors = (Event.addEvent,)
@@ -47,7 +47,7 @@
     context.registerHelp(directory='help')
     utils.ContentInit( 'CMF Event'
                      , content_types = contentClasses
-                     , permission = CMFCorePermissions.AddPortalContent 
+                     , permission = AddPortalContent 
                      , extra_constructors = contentConstructors
                      , fti = Event.factory_type_information
                      ).initialize( context ) 




More information about the CMF-checkins mailing list