source: WAeUP_SRP/trunk/skins/waeup_utilities/open.py @ 5820

Last change on this file since 5820 was 5507, checked in by Henrik Bettermann, 14 years ago

more comfortable than using close.py with transition parameter

  • Property svn:keywords set to Id
File size: 1.0 KB
Line 
1## Script (Python) "open"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=REQUEST,transition='open'
8##title=
9##
10# $Id: open.py 5507 2010-08-28 06:39:05Z henrik $
11"""
12opens object
13"""
14
15mtool = context.portal_membership
16member = mtool.getAuthenticatedMember()
17
18#if str(member) not in ('admin','joachim') or transition is None:
19#    return 'Forbidden!'
20
21if not context.isSectionOfficer() or transition is None:
22    return 'Forbidden!'
23
24import logging
25logger = logging.getLogger('Skins.open')
26
27pm = context.portal_membership
28member = pm.getAuthenticatedMember()
29
30request = context.REQUEST
31wftool = context.portal_workflow
32try:
33    wftool.doActionFor(context,transition)
34    logger.info('%s executed transition %s for %s' % (member,transition,context.getId()))
35except:
36    logger.info('%s tried to execute transition %s for %s, transition not allowed' % (member,transition,context.getId()))
37    return 'Transition not allowed!'
38
39return request.RESPONSE.redirect("%s" % context.absolute_url())
Note: See TracBrowser for help on using the repository browser.