[CMF-checkins] CVS: CMF/CMFCalendar - CalendarTool.py:1.4 Event.py:1.9
Florent Guillaume
fg@nuxeo.com
Sat, 3 Aug 2002 22:32:00 -0400
Update of /cvs-repository/CMF/CMFCalendar
In directory cvs.zope.org:/tmp/cvs-serv17343/CMFCalendar
Modified Files:
CalendarTool.py Event.py
Log Message:
Pure stylistic and code formatting changes:
- Cleanup CMFCorePermissions imports.
- Always put security.declareProtected and friends on a single line
and just in front of the definition they're protecting, so that
automated coherency checking can be done using simple tools like
grep.
=== CMF/CMFCalendar/CalendarTool.py 1.3 => 1.4 ===
from OFS.SimpleItem import SimpleItem
from Globals import InitializeClass
from AccessControl import ClassSecurityInfo
-from Products.CMFCore import CMFCorePermissions
+from Products.CMFCore.CMFCorePermissions import ManagePortal
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
class CalendarTool (UniqueObject, SimpleItem):
@@ -38,13 +38,11 @@
#
# ZMI methods
#
- security.declareProtected( CMFCorePermissions.ManagePortal
- , 'manage_overview' )
+ security.declareProtected( ManagePortal, 'manage_overview' )
manage_overview = PageTemplateFile('www/explainCalendarTool', globals(),
__name__='manage_overview')
- security.declareProtected( CMFCorePermissions.ManagePortal
- , 'manage_configure' )
+ security.declareProtected( ManagePortal, 'manage_configure' )
manage_configure = PageTemplateFile('www/configureCalendarTool', globals(),
__name__='manage_configure')
@@ -52,8 +50,7 @@
self.calendar_types = ['Event']
self.use_session = ""
- security.declareProtected( CMFCorePermissions.ManagePortal
- , 'edit_configuration' )
+ security.declareProtected( ManagePortal, 'edit_configuration' )
def edit_configuration(self, show_types, use_session):
""" Change the configuration of the calendar tool """
self.calendar_types = show_types
=== CMF/CMFCalendar/Event.py 1.8 => 1.9 ===
from Products.CMFCore.WorkflowCore import WorkflowAction
# Import permission names
-from Products.CMFCore import CMFCorePermissions
+from Products.CMFCore.CMFCorePermissions import View
import EventPermissions
# Factory type information -- makes Events objects play nicely
@@ -41,7 +41,7 @@
'actions': ({'id': 'view',
'name': 'View',
'action': 'event_view',
- 'permissions': (CMFCorePermissions.View,)},
+ 'permissions': (View,)},
{'id': 'edit',
'name': 'Edit',
'action': 'event_edit_form',
@@ -105,7 +105,7 @@
# Declarative security
security = ClassSecurityInfo()
- security.declareObjectProtected(CMFCorePermissions.View)
+ security.declareObjectProtected(View)
def __init__(self
, id