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

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"""
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
23   
24res = context.portal_catalog(portal_type="Department",id=info['course_doc'].department)
25if len(res) != 1:
26    return False
27
28roles = member.getRolesInContext(res[0].getObject())
29   
30return "ClearanceOfficer" in roles
31
Note: See TracBrowser for help on using the repository browser.