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