Last change
on this file since 870 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:
645 bytes
|
Line | |
---|
1 | ## Script (Python) "isClearanceOfficer" |
---|
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: isClearanceOfficer.py 870 2006-11-15 17:30:45Z joachim $ |
---|
11 | """ |
---|
12 | |
---|
13 | """ |
---|
14 | wftool = context.portal_workflow |
---|
15 | mtool = context.portal_membership |
---|
16 | member = mtool.getAuthenticatedMember() |
---|
17 | |
---|
18 | info = context.getStudentInfo() |
---|
19 | if info is None: |
---|
20 | return False |
---|
21 | if info['course'] is None: |
---|
22 | return False |
---|
23 | |
---|
24 | res = context.portal_catalog(portal_type="Department",id=info['course_doc'].department) |
---|
25 | if len(res) != 1: |
---|
26 | return False |
---|
27 | |
---|
28 | roles = member.getRolesInContext(res[0].getObject()) |
---|
29 | |
---|
30 | return "ClearanceOfficer" in roles |
---|
31 | |
---|
Note: See
TracBrowser for help on using the repository browser.