Last change
on this file since 7042 was
1959,
checked in by joachim, 17 years ago
|
faster method to detect isStudent
|
File size:
517 bytes
|
Line | |
---|
1 | ## Script (Python) "isCourseAdviser" |
---|
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 1087 2006-12-18 22:13:31Z joachim $ |
---|
11 | member = context.portal_membership.getAuthenticatedMember() |
---|
12 | member_id = str(member) |
---|
13 | o = ord(member_id[1]) |
---|
14 | if o >= 48 and o <= 57: |
---|
15 | return False |
---|
16 | # if context.isStudent(): |
---|
17 | # return False |
---|
18 | roles = member.getRolesInContext(context) |
---|
19 | return "CourseAdviser" in roles |
---|
20 | |
---|
Note: See
TracBrowser for help on using the repository browser.