Last change
on this file since 1957 was
1957,
checked in by joachim, 17 years ago
|
replace calls to isStudent by inline statements, please test.
|
File size:
703 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 | for c in member_id: |
---|
15 | is_student = True |
---|
16 | if c not in ('0123456789'): |
---|
17 | is_student = False |
---|
18 | break |
---|
19 | if is_student and len(member_id) == 7: |
---|
20 | return False |
---|
21 | # if context.isStudent(): |
---|
22 | # return False |
---|
23 | roles = member.getRolesInContext(context) |
---|
24 | return "SectionOfficer" in roles or\ |
---|
25 | "SectionManager" in roles or\ |
---|
26 | "Manager" in roles |
---|
27 | |
---|
Note: See
TracBrowser for help on using the repository browser.