[CMF-checkins] CVS: CMF/CMFCore - ActionInformation.py:1.13 ActionProviderBase.py:1.16 ActionsTool.py:1.37 CMFCorePermissions.py:1.13
Yvo Schubbe
schubbe@web.de
Tue, 4 Feb 2003 17:06:24 -0500
Update of /cvs-repository/CMF/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv32554/CMFCore
Modified Files:
ActionInformation.py ActionProviderBase.py ActionsTool.py
CMFCorePermissions.py
Log Message:
Merged yuppie-buglets1-branch:
- Fixed buglets. (Collector #94 and #95)
- Removed string functions and useless imports.
=== CMF/CMFCore/ActionInformation.py 1.12 => 1.13 ===
--- CMF/CMFCore/ActionInformation.py:1.12 Thu Oct 17 15:38:35 2002
+++ CMF/CMFCore/ActionInformation.py Tue Feb 4 17:06:21 2003
@@ -1,14 +1,15 @@
##############################################################################
#
-# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-#
+# Copyright (c) 2002, 2003 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
-#
+#
##############################################################################
""" Information about customizable actions.
@@ -17,14 +18,12 @@
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
-from Globals import DTMLFile
from Acquisition import aq_inner, aq_parent
from OFS.SimpleItem import SimpleItem
from Expression import Expression
from CMFCorePermissions import View
from CMFCorePermissions import ManagePortal
-from utils import _dtmldir
from utils import getToolByName
class ActionInformation( SimpleItem ):
=== CMF/CMFCore/ActionProviderBase.py 1.15 => 1.16 ===
--- CMF/CMFCore/ActionProviderBase.py:1.15 Wed Dec 18 15:03:54 2002
+++ CMF/CMFCore/ActionProviderBase.py Tue Feb 4 17:06:21 2003
@@ -1,14 +1,15 @@
##############################################################################
#
-# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-#
+# Copyright (c) 2002, 2003 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
-#
+#
##############################################################################
""" Implement a shared base for tools which provide actions.
@@ -17,7 +18,6 @@
from Globals import DTMLFile
from AccessControl import ClassSecurityInfo
-from OFS.SimpleItem import SimpleItem
from ActionInformation import ActionInformation
from CMFCorePermissions import ManagePortal
@@ -36,7 +36,7 @@
security = ClassSecurityInfo()
- _actions = ()
+ _actions = []
_actions_form = DTMLFile( 'editToolsActions', _dtmldir )
manage_options = ( { 'label' : 'Actions'
@@ -64,23 +64,22 @@
""" Show the 'Actions' management tab.
"""
actions = []
- if self.listActions() is not None:
- for a in self.listActions():
+ for a in self.listActions():
- a1 = {}
- a1['id'] = a.getId()
- a1['name'] = a.Title()
- p = a.getPermissions()
- if p:
- a1['permission'] = p[0]
- else:
- a1['permission'] = ''
- a1['category'] = a.getCategory() or 'object'
- a1['visible'] = a.getVisibility()
- a1['action'] = a.getActionExpression()
- a1['condition'] = a.getCondition()
- actions.append(a1)
+ a1 = {}
+ a1['id'] = a.getId()
+ a1['name'] = a.Title()
+ p = a.getPermissions()
+ if p:
+ a1['permission'] = p[0]
+ else:
+ a1['permission'] = ''
+ a1['category'] = a.getCategory() or 'object'
+ a1['visible'] = a.getVisibility()
+ a1['action'] = a.getActionExpression()
+ a1['condition'] = a.getCondition()
+ actions.append(a1)
# possible_permissions is in AccessControl.Role.RoleManager.
pp = self.possible_permissions()
=== CMF/CMFCore/ActionsTool.py 1.36 => 1.37 ===
--- CMF/CMFCore/ActionsTool.py:1.36 Mon Jan 6 15:35:28 2003
+++ CMF/CMFCore/ActionsTool.py Tue Feb 4 17:06:21 2003
@@ -1,14 +1,15 @@
##############################################################################
#
-# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-#
+# Copyright (c) 2001-2003 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
-#
+#
##############################################################################
""" Basic action list tool.
@@ -26,14 +27,11 @@
from ActionProviderBase import ActionProviderBase
from TypesTool import TypeInformation
from CMFCorePermissions import ManagePortal
-
-from utils import UniqueObject
-from utils import SimpleItemWithProperties
-from utils import _getAuthenticatedUser
from utils import _checkPermission
-from utils import getToolByName
from utils import _dtmldir
-from utils import cookString
+from utils import getToolByName
+from utils import SimpleItemWithProperties
+from utils import UniqueObject
from interfaces.portal_actions import portal_actions as IActionsTool
=== CMF/CMFCore/CMFCorePermissions.py 1.12 => 1.13 ===
--- CMF/CMFCore/CMFCorePermissions.py:1.12 Tue Dec 10 16:44:39 2002
+++ CMF/CMFCore/CMFCorePermissions.py Tue Feb 4 17:06:21 2003
@@ -1,6 +1,7 @@
##############################################################################
#
-# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
+# Copyright (c) 2001-2003 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.
@@ -15,8 +16,11 @@
$Id$
"""
-import Globals, AccessControl, Products
+import Products
from AccessControl import Permissions
+from AccessControl.Permission import _registeredPermissions
+from AccessControl.Permission import pname
+from Globals import ApplicationDefaultPermissions
# General Zope permissions
View = Permissions.view
@@ -32,13 +36,13 @@
Sets the defaults roles for a permission.
'''
# XXX This ought to be in AccessControl.SecurityInfo.
- registered = AccessControl.Permission._registeredPermissions
+ registered = _registeredPermissions
if not registered.has_key(permission):
registered[permission] = 1
Products.__ac_permissions__=(
Products.__ac_permissions__+((permission,(),roles),))
- mangled = AccessControl.Permission.pname(permission)
- setattr(Globals.ApplicationDefaultPermissions, mangled, roles)
+ mangled = pname(permission)
+ setattr(ApplicationDefaultPermissions, mangled, roles)
# Note that we can only use the default Zope roles in calls to
# setDefaultRoles(). The default Zope roles are:
@@ -52,7 +56,7 @@
setDefaultRoles( ListFolderContents, ( 'Manager', 'Owner' ) )
ListUndoableChanges = 'List undoable changes'
-setDefaultRoles( ListUndoableChanges, ( 'Manager', 'Member' ) )
+setDefaultRoles( ListUndoableChanges, ('Manager',) ) # + Member
AccessInactivePortalContent = 'Access inactive portal content'
setDefaultRoles(AccessInactivePortalContent, ('Manager',))
@@ -73,7 +77,7 @@
setDefaultRoles(ManageProperties, ('Owner','Manager',))
ListPortalMembers = 'List portal members'
-setDefaultRoles(ListPortalMembers, ('Manager', 'Member'))
+setDefaultRoles( ListPortalMembers, ('Manager',) ) # + Member
AddPortalFolders = 'Add portal folders'
setDefaultRoles(AddPortalFolders, ('Owner','Manager')) # + Member