Last change
on this file since 868 was
867,
checked in by joachim, 19 years ago
|
patch for default field width in stringWidgets
isClearanceOfficer added
|
-
Property svn:keywords set to
Id
|
File size:
670 bytes
|
Rev | Line | |
---|
[867] | 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=REQUEST |
---|
| 8 | ##title= |
---|
| 9 | ## |
---|
| 10 | # $Id: isClearanceOfficer.py 867 2006-11-14 16:15:38Z joachim $ |
---|
| 11 | """ |
---|
| 12 | |
---|
| 13 | """ |
---|
| 14 | request = REQUEST |
---|
| 15 | wftool = context.portal_workflow |
---|
| 16 | mtool = context.portal_membership |
---|
| 17 | member = mtool.getAuthenticatedMember() |
---|
| 18 | |
---|
| 19 | info = context.getStudentInfo() |
---|
| 20 | if info is None: |
---|
| 21 | return False |
---|
| 22 | if info['course'] is None: |
---|
| 23 | return False |
---|
| 24 | |
---|
| 25 | |
---|
| 26 | res = context.portal_catalog(portal_type="Department",id=info['course_doc'].department) |
---|
| 27 | if len res != 1: |
---|
| 28 | return False |
---|
| 29 | |
---|
| 30 | roles = member.getRolesInContext(res[0].getObject()) |
---|
| 31 | |
---|
| 32 | return "ClearanceOfficer" in roles |
---|
| 33 | |
---|
Note: See
TracBrowser for help on using the repository browser.