[CMF-checkins] CVS: CMF - ActionsTool.py:1.11 CMFCorePermissions.py:1.7 PortalFolder.py:1.19
tseaver@digicool.com
tseaver@digicool.com
Tue, 19 Jun 2001 15:15:26 -0400 (EDT)
Update of /cvs-repository/CMF/CMFCore
In directory korak.digicool.com:/tmp/cvs-serv18453/CMFCore
Modified Files:
ActionsTool.py CMFCorePermissions.py PortalFolder.py
Log Message:
- Merge changes to implement new permission, "List folder contents",
used by 'folder_contents', 'CMFCore.PortalFolder', etc. to protect
the "contents" view of a folder (Tracker #320).
Note that this is really only a UI change: 'PortalFolder.contentIds',
'PortalFolder.contentValues', and 'PortalFolder.contentItems' are
still public, to allow for reasonable "site map" views on folders.
--- Updated File ActionsTool.py in package CMF --
--- ActionsTool.py 2001/06/07 00:23:45 1.10
+++ ActionsTool.py 2001/06/19 19:14:55 1.11
@@ -301,7 +301,7 @@
actions.append({
'name': 'Folder contents',
'url': folder_url + '/folder_contents',
- 'permissions' : ['Access contents information'],
+ 'permissions' : ['List folder contents'],
'category': 'folder',
})
pm = getToolByName(self, 'portal_membership')
--- Updated File CMFCorePermissions.py in package CMF --
--- CMFCorePermissions.py 2001/05/24 20:39:39 1.6
+++ CMFCorePermissions.py 2001/06/19 19:14:55 1.7
@@ -32,6 +32,9 @@
# CMF Base Permissions
#
+ListFolderContents = 'List folder contents'
+setDefaultRoles( ListFolderContents, ( 'Manager', 'Owner' ) )
+
AccessInactivePortalContent = 'Access inactive portal content'
setDefaultRoles(AccessInactivePortalContent, ('Manager',))
--- Updated File PortalFolder.py in package CMF --
--- PortalFolder.py 2001/06/13 00:08:46 1.18
+++ PortalFolder.py 2001/06/19 19:14:55 1.19
@@ -91,7 +91,7 @@
import Globals, re, base64, marshal, string
import CMFCorePermissions
-from CMFCorePermissions import View, ManageProperties
+from CMFCorePermissions import View, ManageProperties, ListFolderContents
from CMFCorePermissions import AddPortalFolders, AddPortalContent
from OFS.Folder import Folder
from OFS.ObjectManager import REPLACEABLE
@@ -183,7 +183,7 @@
ob=PortalFolder(id, title)
self._setObject(id, ob)
if REQUEST is not None:
- return self.folder_contents(
+ return self.folder_contents( # XXX: ick!
self, REQUEST, portal_status_message="Folder added")
def _morphSpec(self, spec):
@@ -259,6 +259,15 @@
ids = self.objectIds( spec )
return map( lambda item: item[1],
self._filteredItems( ids, filter ) )
+
+ security.declareProtected( ListFolderContents
+ , 'listFolderContents' )
+ def listFolderContents( self, spec=None, filter=None ): # XXX
+ """
+ Hook around 'contentValues' to let 'folder_contents'
+ be protected.
+ """
+ return self.contentValues( filter=filter )
security.declarePublic('contentItems')
def contentItems( self, spec=None, filter=None ):