|
a/scripts/migrations/007-update-acls.py |
|
b/scripts/migrations/007-update-acls.py |
|
... |
|
... |
71 |
log.info('====================================')
|
71 |
log.info('====================================')
|
72 |
log.info('Update artifact ACLs for %s', ac['_id'])
|
72 |
log.info('Update artifact ACLs for %s', ac['_id'])
|
73 |
for _, a_cls in dfs(M.Artifact, graph):
|
73 |
for _, a_cls in dfs(M.Artifact, graph):
|
74 |
c_artifact = project_db[a_cls.__mongometa__.name]
|
74 |
c_artifact = project_db[a_cls.__mongometa__.name]
|
75 |
for a in c_artifact.find(dict(app_config_id=ac['_id'])):
|
75 |
for a in c_artifact.find(dict(app_config_id=ac['_id'])):
|
76 |
empty_acl = not a['acl']
|
76 |
empty_acl = a['acl'] == []
|
77 |
simple_acl_update(a, a_cls.__mongometa__.name)
|
77 |
simple_acl_update(a, a_cls.__mongometa__.name)
|
78 |
if not options.test and not empty_acl: c_artifact.save(a)
|
78 |
if not options.test and not empty_acl: c_artifact.save(a)
|
79 |
|
79 |
|
80 |
def update_project_acl(project_doc):
|
80 |
def update_project_acl(project_doc):
|
81 |
'''Convert the old dict-style ACL to a list of ALLOW ACEs. Also move the
|
81 |
'''Convert the old dict-style ACL to a list of ALLOW ACEs. Also move the
|