Last change
on this file since 874 was
870,
checked in by joachim, 18 years ago
|
added owner_guard and clearance_officer_guard
modified waeup_student_wf to use those.
|
-
Property svn:keywords set to
Id
|
File size:
574 bytes
|
Line | |
---|
1 | ## Script (Python) "owner_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: owner_guard.py 870 2006-11-15 17:30:45Z joachim $ |
---|
11 | """ |
---|
12 | check if the current action is allowed for the + owner |
---|
13 | """ |
---|
14 | |
---|
15 | mtool = context.portal_membership |
---|
16 | member = mtool.getAuthenticatedMember() |
---|
17 | roles = member.getRolesInContext(context) |
---|
18 | |
---|
19 | def intersection(a,b): |
---|
20 | r = [] |
---|
21 | for i in a: |
---|
22 | if i in b: |
---|
23 | r.append(i) |
---|
24 | return r |
---|
25 | |
---|
26 | if len(intersection(('Manager', 'SectionManager','Owner'),roles)) > 0: |
---|
27 | return True |
---|
28 | return True |
---|
Note: See
TracBrowser for help on using the repository browser.