def reset_security_workflow(root, output=None): count = 0 for node in postorder(root): if IContent.providedBy(node): if has_custom_acl(node): continue # don't mess with objects customized via edit_acl content_type = get_content_type(node) workflow = get_workflow(content_type, 'security', node) if workflow is not None: try: state, msg = workflow.reset(node) except: if output is not None: output('Error while resetting %s' % resource_path(node)) raise if output is not None: if msg: output(msg) count += 1 if output is not None: output('updated %d content objects' % count)
def is_content(model): """ Return True if the model object provides any interface registered as a content type, False otherwise. """ return IContent.providedBy(model)