## Script (Python) "owner_guard" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters= ##title= ## # $Id: owner_guard.py 870 2006-11-15 17:30:45Z joachim $ """ check if the current action is allowed for the + owner """ 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 len(intersection(('Manager', 'SectionManager','Owner'),roles)) > 0: return True return True