## Script (Python) "get_searchable_review_states" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters=key=None ##title= ## # $Id: get_searchable_student_states.py 1033 2006-12-12 11:05:00Z joachim $ """ return the searchable student_states depending on context """ wftool = context.portal_workflow mtool = context.portal_membership member = mtool.getAuthenticatedMember() roles = member.getRolesInContext(context) voc = context.portal_vocabularies.searchable_student_states if key is not None: return voc.get(key) if "ClearanceOfficers" in member.getGroups(): return [item for item in voc.items() if item[0].startswith('clear') or item[0] in ("all",)] return voc.items()