示例#1
0
文件: evolve6.py 项目: boothead/karl
def evolve(context):
    root = find_root(context)
    searcher = ICatalogSearch(root)
    total, docids, resolver = searcher(interfaces=[IForumTopic])
    count = 0
    workflow = get_workflow(IForumTopic, 'security')
    for docid in docids:
        topic = resolver(docid)
        if has_custom_acl(topic):
            continue # don't mess with objects customized via edit_acl
        try:
            state, msg = workflow.reset(topic)
        except:
            print "ERROR while resetting topic workflow: %s" % model_path(topic)
        else:
            print "Reset topic workflow: %s" % model_path(topic)
            count += 1
    print "Updated %d forum topic workflows" % count
示例#2
0
文件: evolve6.py 项目: iotest3/new
def evolve(context):
    root = find_root(context)
    searcher = ICatalogSearch(root)
    total, docids, resolver = searcher(interfaces=[IForumTopic])
    count = 0
    workflow = get_workflow(IForumTopic, 'security')
    for docid in docids:
        topic = resolver(docid)
        if has_custom_acl(topic):
            continue  # don't mess with objects customized via edit_acl
        try:
            state, msg = workflow.reset(topic)
        except:
            print "ERROR while resetting topic workflow: %s" % resource_path(
                topic)
        else:
            print "Reset topic workflow: %s" % resource_path(topic)
            count += 1
    print "Updated %d forum topic workflows" % count
示例#3
0
 def _callFUT(self, ob):
     from karl.security.workflow import has_custom_acl
     return has_custom_acl(ob)
示例#4
0
文件: tests.py 项目: lslaz1/karl
 def _callFUT(self, ob):
     from karl.security.workflow import has_custom_acl
     return has_custom_acl(ob)