def main_recipient(self): person = IPerson(self.request, None) if self.context.recipients is None: return None recipients = sorted(self.context.recipients, key=lambda r: r.__name__) if person in recipients: return person for recipient in recipients: if flourish.canView(recipient): return recipient return None
def __call__(self, *args, **kw): if not flourish.canView(self.container): raise Unauthorized("No permission to view groups.") return flourish.page.Page.__call__(self, *args, **kw)