Last change
on this file since 1960 was
1959,
checked in by joachim, 17 years ago
|
faster method to detect isStudent
|
File size:
596 bytes
|
Line | |
---|
1 | ## Script (Python) "isSectionOfficer" |
---|
2 | ##bind container=container |
---|
3 | ##bind context=context |
---|
4 | ##bind namespace= |
---|
5 | ##bind script=script |
---|
6 | ##bind subpath=traverse_subpath |
---|
7 | ##parameters=student=None |
---|
8 | ##title= |
---|
9 | ## |
---|
10 | # $Id: isManager.py 888 2006-11-17 21:28:48Z henrik $ |
---|
11 | |
---|
12 | member = context.portal_membership.getAuthenticatedMember() |
---|
13 | member_id = str(member) |
---|
14 | o = ord(member_id[1]) |
---|
15 | if o >= 48 and o <= 57: |
---|
16 | return False |
---|
17 | # if context.isStudent(): |
---|
18 | # return False |
---|
19 | roles = member.getRolesInContext(context) |
---|
20 | return "SectionOfficer" in roles or\ |
---|
21 | "SectionManager" in roles or\ |
---|
22 | "Manager" in roles |
---|
23 | |
---|
Note: See
TracBrowser for help on using the repository browser.