Last change
on this file since 873 was
871,
checked in by Henrik Bettermann, 19 years ago
|
layout of admission form/slip modified
|
-
Property svn:keywords set to
Id
|
File size:
657 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 |
---|
[870] | 7 | ##parameters= |
---|
[867] | 8 | ##title= |
---|
| 9 | ## |
---|
| 10 | # $Id: isClearanceOfficer.py 871 2006-11-16 06:06:53Z henrik $ |
---|
| 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 |
---|
[871] | 23 | |
---|
[867] | 24 | res = context.portal_catalog(portal_type="Department",id=info['course_doc'].department) |
---|
[870] | 25 | if len(res) != 1: |
---|
[867] | 26 | return False |
---|
| 27 | |
---|
| 28 | roles = member.getRolesInContext(res[0].getObject()) |
---|
| 29 | |
---|
[871] | 30 | return "ClearanceOfficer" in roles or context.isManager |
---|
| 31 | |
---|
Note: See
TracBrowser for help on using the repository browser.