Back to index

plone3  3.1.7
Functions | Variables
CMFPlone.patches.csrf Namespace Reference

Functions

def applyPatches

Variables

tuple patch = protect(CheckAuthenticator)

Function Documentation

apply csrf-protection decorator to all relevant methods 

Definition at line 7 of file csrf.py.

00007 
00008 def applyPatches():
00009     """ apply csrf-protection decorator to all relevant methods """
00010 
00011     from Products.CMFPlone.PloneTool import PloneTool as PT
00012     PT.setMemberProperties = patch(PT.setMemberProperties)
00013     PT.changeOwnershipOf = patch(PT.changeOwnershipOf)
00014     PT.acquireLocalRoles = patch(PT.acquireLocalRoles)
00015     PT.deleteObjectsByPaths = patch(PT.deleteObjectsByPaths)
00016     PT.transitionObjectsByPaths = patch(PT.transitionObjectsByPaths)
00017     PT.renameObjectsByPaths = patch(PT.renameObjectsByPaths)
00018 
00019     from plone.session.plugins.session import SessionPlugin as SP
00020     SP.manage_clearSecrets = patch(SP.manage_clearSecrets)
00021     SP.manage_createNewSecret = patch(SP.manage_createNewSecret)
00022 
00023     from Products.CMFCore.RegistrationTool import RegistrationTool
00024     RegistrationTool.addMember = patch(RegistrationTool.addMember)
00025 
00026     from Products.CMFCore.MembershipTool import MembershipTool as MT
00027     from Products.CMFPlone.MembershipTool import MembershipTool as PMT
00028     MT.setPassword = patch(MT.setPassword)
00029     PMT.setPassword = patch(PMT.setPassword)
00030     MT.setRoleMapping = patch(MT.setRoleMapping)
00031     MT.deleteMemberArea = patch(MT.deleteMemberArea)
00032     MT.setLocalRoles = patch(MT.setLocalRoles)
00033     MT.deleteLocalRoles = patch(MT.deleteLocalRoles)
00034     MT.deleteMembers = patch(MT.deleteMembers)
00035 
00036     from Products.CMFCore.MemberDataTool import MemberData as MD
00037     original_setProperties = MD.setProperties
00038     def setProperties(self, properties=None, REQUEST=None, **kw):
00039         return original_setProperties(self, properties, **kw)
00040     setProperties.__doc__ = original_setProperties.__doc__
00041     MD.setProperties = patch(setProperties)
00042 
00043     from Products.CMFDefault.RegistrationTool import RegistrationTool
00044     RegistrationTool.editMember = patch(RegistrationTool.editMember)
00045 
00046     from Products.PlonePAS.tools.groupdata import GroupData
00047     GroupData.addMember = patch(GroupData.addMember)
00048     GroupData.removeMember = patch(GroupData.removeMember)
00049 
00050     from Products.PluggableAuthService.PluggableAuthService import \
00051          PluggableAuthService as PAS
00052     PAS.userFolderAddUser = patch(PAS.userFolderAddUser)
00053     PAS.userFolderEditUser = patch(PAS.userFolderEditUser)
00054     PAS.userFolderDelUsers = patch(PAS.userFolderDelUsers)
00055 

Here is the call graph for this function:


Variable Documentation

tuple CMFPlone.patches.csrf.patch = protect(CheckAuthenticator)

Definition at line 4 of file csrf.py.