source: WAeUP_SRP/trunk/skins/waeup_student/isClearanceOfficer.py @ 873

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
RevLine 
[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"""
14wftool = context.portal_workflow
15mtool = context.portal_membership
16member = mtool.getAuthenticatedMember()
17
18info = context.getStudentInfo()
19if info is None:
20    return False
21if info['course'] is None:
22    return False
[871]23
[867]24res = context.portal_catalog(portal_type="Department",id=info['course_doc'].department)
[870]25if len(res) != 1:
[867]26    return False
27
28roles = member.getRolesInContext(res[0].getObject())
29
[871]30return "ClearanceOfficer" in roles or context.isManager
31
Note: See TracBrowser for help on using the repository browser.