source: WAeUP_SRP/trunk/skins/waeup_student/clearance_officer_guard.py @ 879

Last change on this file since 879 was 872, checked in by Henrik Bettermann, 18 years ago

Boolean logic was 'and', must be 'or'

  • Property svn:keywords set to Id
File size: 664 bytes
Line 
1## Script (Python) "clearance_officer_guard"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=
8##title=
9##
10# $Id: clearance_officer_guard.py 872 2006-11-16 06:26:56Z henrik $
11"""
12check if the current action is allowed for the clearance_officer
13
14"""
15wftool = context.portal_workflow
16mtool = context.portal_membership
17member = mtool.getAuthenticatedMember()
18roles = member.getRolesInContext(context)
19
20def intersection(a,b):
21    r = []
22    for i in a:
23        if i in b:
24            r.append(i)
25    return r
26if intersection(('Manager', 'SectionManager'),roles)\
27                  or context.isClearanceOfficer():
28    return True
29return False
30
Note: See TracBrowser for help on using the repository browser.