X-Git-Url: https://scm.cri.mines-paristech.fr/git/Plinn.git/blobdiff_plain/3e0a2c257d49fb162da9c70d2f70194036235166..a8ce11cea15f572925793b181a06fdd5b9b4127a:/patch.py diff --git a/patch.py b/patch.py index badf42a..ebc324f 100644 --- a/patch.py +++ b/patch.py @@ -1,11 +1,40 @@ """ Plinn monkey patch -$Id: patch.py 1458 2009-01-30 18:11:21Z pin $ -$URL: http://svn.cri.ensmp.fr/svn/Plinn/branches/CMF-2.1/patch.py $ + + """ +from AccessControl import ClassSecurityInfo +from Products.CMFCore.permissions import ListFolderContents, View, ViewManagementScreens,\ + ManageProperties, AddPortalFolders, AddPortalContent,\ + ManagePortal, ModifyPortalContent + from Products.CMFCore.PortalFolder import PortalFolder as CMFPortalFolder from Folder import PlinnFolder +from utils import getCPInfo, popCP +cmfPortalFolderSecurity = ClassSecurityInfo() + +cmfPortalFolderSecurity.declareProtected(ListFolderContents, 'listFolderContents') CMFPortalFolder.listFolderContents = PlinnFolder.listFolderContents.im_func + +cmfPortalFolderSecurity.declareProtected(ListFolderContents, 'listNearestFolderContents') CMFPortalFolder.listNearestFolderContents = PlinnFolder.listNearestFolderContents.im_func + +cmfPortalFolderSecurity.declareProtected(ListFolderContents, 'listCatalogedContents') CMFPortalFolder.listCatalogedContents = PlinnFolder.listCatalogedContents.im_func + +cmfPortalFolderSecurity.declareProtected(AddPortalContent, 'put_upload') +CMFPortalFolder.put_upload = PlinnFolder.put_upload.im_func + +cmfPortalFolderSecurity.declarePublic('getCPInfo') +CMFPortalFolder.getCPInfo = getCPInfo + +cmfPortalFolderSecurity.declarePublic('getCP') +CMFPortalFolder.popCP = popCP + +cmfPortalFolderSecurity.apply(CMFPortalFolder) + + +from Products.CMFDefault.formlib.form import _EditFormMixin +from patch_impl import _setRedirect +_EditFormMixin._setRedirect = _setRedirect \ No newline at end of file