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 | """ |
---|
12 | check if the current action is allowed for the clearance_officer |
---|
13 | |
---|
14 | """ |
---|
15 | wftool = context.portal_workflow |
---|
16 | mtool = context.portal_membership |
---|
17 | member = mtool.getAuthenticatedMember() |
---|
18 | roles = member.getRolesInContext(context) |
---|
19 | |
---|
20 | def intersection(a,b): |
---|
21 | r = [] |
---|
22 | for i in a: |
---|
23 | if i in b: |
---|
24 | r.append(i) |
---|
25 | return r |
---|
26 | if intersection(('Manager', 'SectionManager'),roles)\ |
---|
27 | or context.isClearanceOfficer(): |
---|
28 | return True |
---|
29 | return False |
---|
30 | |
---|
Note: See
TracBrowser for help on using the repository browser.