Back to index

plone3  3.1.7
folder_localrole_set.py
Go to the documentation of this file.
00001 ## Script (Python) "folder_localrole_set"
00002 ##parameters=use_acquisition=0
00003 ##title=set acquitision
00004 ##
00005 
00006 from Products.CMFPlone.utils import transaction_note
00007 from Products.CMFPlone import PloneMessageFactory as _
00008 
00009 putils = context.plone_utils
00010 putils.acquireLocalRoles(context, use_acquisition, REQUEST=context.REQUEST)
00011 if use_acquisition:
00012     msg=_(u'Role Acquisition is now turned on.')
00013 else:
00014     msg=_(u'Role Acquisition is now turned off.')
00015 
00016 transaction_note('Modified acquisition settings for folder %s at %s' % (context.title_or_id(), context.absolute_url()))
00017 context.plone_utils.addPortalMessage(msg)
00018 
00019 context.REQUEST.RESPONSE.redirect(context.absolute_url() + '/folder_localrole_form')