## Script (Python) "isStudent" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters= ##title= ## # $Id: isStudent.py 1042 2006-12-13 13:35:50Z joachim $ #session = context.REQUEST.SESSION #roles = member.getRolesInContext(context) #return "Student" in roles mtool = context.portal_membership member = mtool.getAuthenticatedMember() member_id = str(member) if len(member_id) == 7: try: int(member_id[1:]) return True except: return False