## Script (Python) "clearance_officer_guard" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters= ##title= ## # $Id: clearance_officer_guard.py 872 2006-11-16 06:26:56Z henrik $ """ check if the current action is allowed for the clearance_officer """ wftool = context.portal_workflow mtool = context.portal_membership member = mtool.getAuthenticatedMember() roles = member.getRolesInContext(context) def intersection(a,b): r = [] for i in a: if i in b: r.append(i) return r if intersection(('Manager', 'SectionManager'),roles)\ or context.isClearanceOfficer(): return True return False