[PATCH seda V2] [migration] Add missing bits of migration

Sylvain Thenault sylvain.thenault at logilab.fr
Thu Mar 9 10:59:02 CET 2017


# HG changeset patch
# User Sylvain Thénault <sylvain.thenault at logilab.fr>
# Date 1489011066 -3600
#      Wed Mar 08 23:11:06 2017 +0100
# Node ID 11bb8cb5c00fca41e9b5d87bdca1a55d02abcfa7
# Parent  22b591ad3be1570a5104add188131ff489bf2460
[migration] Add missing bits of migration

ensure permissions of relation impacted by 22b591ad3be1 are synced.

diff --git a/cubicweb_eac/migration/0.5.0_Any.py b/cubicweb_eac/migration/0.5.0_Any.py
--- a/cubicweb_eac/migration/0.5.0_Any.py
+++ b/cubicweb_eac/migration/0.5.0_Any.py
@@ -1,1 +1,14 @@
+from cubicweb_compound import utils
+from cubicweb_eac import AuthorityRecordGraph
+
 add_cube('compound')
+
+graph = AuthorityRecordGraph(schema)
+structure = graph.parent_structure('AuthorityRecord')
+
+optionals = utils.optional_relations(schema, structure)
+for child in structure:
+    sync_schema_props_perms(child, syncprops=False)
+
+for rdef, parent_role in utils.mandatory_rdefs(schema, structure):
+    sync_schema_props_perms((rdef.subject, rdef.rtype, rdef.object), syncprops=False)


More information about the saem-devel mailing list