| Rev | Line | |
|---|
| [1975] | 1 | ## Script (Python) "isSectionOfficer" |
|---|
| [911] | 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 | |
|---|
| [1957] | 12 | member = context.portal_membership.getAuthenticatedMember() |
|---|
| 13 | member_id = str(member) |
|---|
| [1972] | 14 | o = ord(member_id[1]) |
|---|
| [1959] | 15 | if o >= 48 and o <= 57: |
|---|
| [1077] | 16 | return False |
|---|
| [1957] | 17 | # if context.isStudent(): |
|---|
| 18 | # return False |
|---|
| 19 | roles = member.getRolesInContext(context) |
|---|
| [1077] | 20 | return "SectionOfficer" in roles or\ |
|---|
| 21 | "SectionManager" in roles or\ |
|---|
| [1972] | 22 | "Manager" in roles |
|---|
| 23 | |
|---|
Note: See
TracBrowser for help on using the repository browser.