[CMF-checkins] CVS: CMF/CMFCore - ActionInformation.py:1.17
ActionsTool.py:1.40 CatalogTool.py:1.44
CookieCrumbler.py:1.22 DiscussionTool.py:1.12
FSDTMLMethod.py:1.17 RegistrationTool.py:1.21
TypesTool.py:1.61 UndoTool.py:1.15
Yvo Schubbe
schubbe at web.de
Mon Sep 1 12:19:05 EDT 2003
Update of /cvs-repository/CMF/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv30605/CMFCore
Modified Files:
ActionInformation.py ActionsTool.py CatalogTool.py
CookieCrumbler.py DiscussionTool.py FSDTMLMethod.py
RegistrationTool.py TypesTool.py UndoTool.py
Log Message:
Permissions cleanup
=== CMF/CMFCore/ActionInformation.py 1.16 => 1.17 ===
--- CMF/CMFCore/ActionInformation.py:1.16 Fri May 9 17:40:23 2003
+++ CMF/CMFCore/ActionInformation.py Mon Sep 1 11:18:34 2003
@@ -22,7 +22,6 @@
from Expression import Expression
from CMFCorePermissions import View
-from CMFCorePermissions import ManagePortal
from utils import getToolByName
from types import StringType
=== CMF/CMFCore/ActionsTool.py 1.39 => 1.40 ===
--- CMF/CMFCore/ActionsTool.py:1.39 Tue Apr 15 12:08:01 2003
+++ CMF/CMFCore/ActionsTool.py Mon Sep 1 11:18:34 2003
@@ -25,6 +25,7 @@
from ActionInformation import ActionInformation, oai
from ActionProviderBase import ActionProviderBase
from TypesTool import TypeInformation
+from CMFCorePermissions import ListFolderContents
from CMFCorePermissions import ManagePortal
from utils import _checkPermission
from utils import _dtmldir
@@ -51,7 +52,7 @@
text='string: ${folder_url}/folder_contents')
, condition=Expression(
text='python: folder is not object')
- , permissions=('List folder contents',)
+ , permissions=(ListFolderContents,)
, category='object'
, visible=1
)
@@ -61,7 +62,7 @@
text='string: ${folder_url}/folder_contents')
, condition=Expression(
text='python: folder is object')
- , permissions=('List folder contents',)
+ , permissions=(ListFolderContents,)
, category='folder'
, visible=1
)
=== CMF/CMFCore/CatalogTool.py 1.43 => 1.44 ===
--- CMF/CMFCore/CatalogTool.py:1.43 Mon Apr 28 12:45:11 2003
+++ CMF/CMFCore/CatalogTool.py Mon Sep 1 11:18:34 2003
@@ -28,8 +28,9 @@
from ActionProviderBase import ActionProviderBase
from ActionInformation import ActionInformation
from Expression import Expression
-from CMFCorePermissions import ManagePortal
from CMFCorePermissions import AccessInactivePortalContent
+from CMFCorePermissions import ManagePortal
+from CMFCorePermissions import View
from Acquisition import aq_base
from interfaces.portal_catalog \
@@ -58,7 +59,7 @@
"""
ob = self.__ob
allowed = {}
- for r in rolesForPermissionOn('View', ob):
+ for r in rolesForPermissionOn(View, ob):
allowed[r] = 1
localroles = _mergedLocalRoles(ob)
for user, roles in localroles.items():
=== CMF/CMFCore/CookieCrumbler.py 1.21 => 1.22 ===
--- CMF/CMFCore/CookieCrumbler.py:1.21 Mon Jun 16 13:39:08 2003
+++ CMF/CMFCore/CookieCrumbler.py Mon Sep 1 11:18:34 2003
@@ -1,14 +1,14 @@
##############################################################################
#
# 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
-#
+#
##############################################################################
""" Cookie Crumbler: Enable cookies for non-cookie user folders.
@@ -19,24 +19,23 @@
from urllib import quote, unquote
from Acquisition import aq_inner, aq_parent
from DateTime import DateTime
-from utils import SimpleItemWithProperties
-from AccessControl import ClassSecurityInfo, Permissions
+from AccessControl import ClassSecurityInfo
from ZPublisher import BeforeTraverse
import Globals
from Globals import HTMLFile
from zLOG import LOG, ERROR
import sys
-
from ZPublisher.HTTPRequest import HTTPRequest
+from CMFCorePermissions import ModifyCookieCrumblers
+from CMFCorePermissions import ViewManagementScreens
+from utils import SimpleItemWithProperties
+
# Constants.
ATTEMPT_NONE = 0 # No attempt at authentication
ATTEMPT_LOGIN = 1 # Attempt to log in
ATTEMPT_RESUME = 2 # Attempt to resume session
-
-ModifyCookieCrumblers = 'Modify Cookie Crumblers'
-ViewManagementScreens = Permissions.view_management_screens
class CookieCrumblerDisabled (Exception):
=== CMF/CMFCore/DiscussionTool.py 1.11 => 1.12 ===
--- CMF/CMFCore/DiscussionTool.py:1.11 Thu Feb 13 03:28:42 2003
+++ CMF/CMFCore/DiscussionTool.py Mon Sep 1 11:18:34 2003
@@ -18,10 +18,10 @@
from utils import _dtmldir
from utils import getToolByName
from utils import UniqueObject
-from CMFCorePermissions import ReplyToItem
-from CMFCorePermissions import View
from CMFCorePermissions import AccessContentsInformation
from CMFCorePermissions import ManagePortal
+from CMFCorePermissions import ReplyToItem
+from CMFCorePermissions import View
from OFS.SimpleItem import SimpleItem
from Globals import InitializeClass, DTMLFile
from Acquisition import Implicit
@@ -170,7 +170,7 @@
actions = (
{'name': 'Reply',
'url': discussion_url + '/discussion_reply_form',
- 'permissions': ['Reply to item'],
+ 'permissions': [ReplyToItem],
'category': 'object'
},
)
=== CMF/CMFCore/FSDTMLMethod.py 1.16 => 1.17 ===
--- CMF/CMFCore/FSDTMLMethod.py:1.16 Mon Mar 24 00:03:08 2003
+++ CMF/CMFCore/FSDTMLMethod.py Mon Sep 1 11:18:34 2003
@@ -1,32 +1,29 @@
##############################################################################
#
# 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
-#
+#
##############################################################################
""" Customizable DTML methods that come from the filesystem.
$Id$
"""
-from string import split
-from os import path, stat
-
import Globals
-from AccessControl import ClassSecurityInfo, getSecurityManager, Permissions
+from AccessControl import ClassSecurityInfo, getSecurityManager
from OFS.DTMLMethod import DTMLMethod, decapitate, guess_content_type
from AccessControl.Role import RoleManager
from utils import _dtmldir
+from CMFCorePermissions import FTPAccess
from CMFCorePermissions import View
from CMFCorePermissions import ViewManagementScreens
-from CMFCorePermissions import FTPAccess
from DirectoryView import registerFileExtension, registerMetaType, expandpath
from FSObject import FSObject
=== CMF/CMFCore/RegistrationTool.py 1.20 => 1.21 ===
--- CMF/CMFCore/RegistrationTool.py:1.20 Thu Feb 13 03:31:01 2003
+++ CMF/CMFCore/RegistrationTool.py Mon Sep 1 11:18:34 2003
@@ -25,13 +25,9 @@
from string import digits
from ActionProviderBase import ActionProviderBase
-
from CMFCorePermissions import AddPortalMember
from CMFCorePermissions import MailForgottenPassword
-from CMFCorePermissions import SetOwnPassword
-from CMFCorePermissions import SetOwnProperties
from CMFCorePermissions import ManagePortal
-
from utils import UniqueObject
from utils import _checkPermission
from utils import _limitGrantedRoles
=== CMF/CMFCore/TypesTool.py 1.60 => 1.61 ===
--- CMF/CMFCore/TypesTool.py:1.60 Thu Jul 31 11:47:18 2003
+++ CMF/CMFCore/TypesTool.py Mon Sep 1 11:18:34 2003
@@ -14,6 +14,7 @@
$Id$
"""
+
import sys
from Globals import DTMLFile
@@ -32,11 +33,9 @@
from interfaces.portal_types import portal_types as ITypesTool
from ActionProviderBase import ActionProviderBase
-
-from CMFCorePermissions import View
-from CMFCorePermissions import ManagePortal
from CMFCorePermissions import AccessContentsInformation
-
+from CMFCorePermissions import ManagePortal
+from CMFCorePermissions import View
from utils import UniqueObject
from utils import SimpleItemWithProperties
from utils import _dtmldir
@@ -621,11 +620,11 @@
{'class':FactoryTypeInformation,
'name':FactoryTypeInformation.meta_type,
'action':'manage_addFactoryTIForm',
- 'permission':'Manage portal'},
+ 'permission':ManagePortal},
{'class':ScriptableTypeInformation,
'name':ScriptableTypeInformation.meta_type,
'action':'manage_addScriptableTIForm',
- 'permission':'Manage portal'},
+ 'permission':ManagePortal},
]
=== CMF/CMFCore/UndoTool.py 1.14 => 1.15 ===
--- CMF/CMFCore/UndoTool.py:1.14 Thu Feb 13 02:44:48 2003
+++ CMF/CMFCore/UndoTool.py Mon Sep 1 11:18:34 2003
@@ -26,8 +26,8 @@
from Expression import Expression
from ActionInformation import ActionInformation
from ActionProviderBase import ActionProviderBase
-from CMFCorePermissions import ManagePortal
from CMFCorePermissions import ListUndoableChanges
+from CMFCorePermissions import ManagePortal
from interfaces.portal_undo import portal_undo as IUndoTool
@@ -85,7 +85,7 @@
for t in transactions:
# Ensure transaction ids don't have embedded LF.
t['id'] = t['id'].replace('\n', '')
- if not _checkPermission('Manage portal', portal):
+ if not _checkPermission(ManagePortal, portal):
# Filter out transactions done by other members of the portal.
user_id = _getAuthenticatedUser(self).getId()
transactions = filter(
More information about the CMF-checkins
mailing list