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