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

Last change on this file since 879 was 875, checked in by joachim, 19 years ago

special search_form for clearance-officers,
only clearance-states can be searched,
only students for whom the member is ClearanceOfficer? will be shown.

  • Property svn:keywords set to Id
File size: 666 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=info=None
8##title=
9##
10# $Id: isClearanceOfficer.py 875 2006-11-16 14:21:44Z joachim $
11"""
12
13"""
14wftool = context.portal_workflow
15mtool = context.portal_membership
16member = mtool.getAuthenticatedMember()
17
18if info is None:
19    info = context.getStudentInfo()
20if info is None:
21    return False
22if info['course'] is None:
23    return False
24
25res = context.portal_catalog(portal_type="Department",id=info['course_doc'].department)
26if len(res) != 1:
27    return False
28
29roles = member.getRolesInContext(res[0].getObject())
30
31return "ClearanceOfficer" in roles
32
Note: See TracBrowser for help on using the repository browser.