misc/migration/bootstrapmigration_repository.py
changeset 4834 b718626a0e60
parent 4570 ede247bbbf62
child 4835 13b0b96d7982
equal deleted inserted replaced
4833:41a78fb4107c 4834:b718626a0e60
    30 elif applcubicwebversion < (3, 6, 0) and cubicwebversion >= (3, 6, 0):
    30 elif applcubicwebversion < (3, 6, 0) and cubicwebversion >= (3, 6, 0):
    31     session.set_pool()
    31     session.set_pool()
    32     session.execute = session.unsafe_execute
    32     session.execute = session.unsafe_execute
    33     permsdict = ss.deserialize_ertype_permissions(session)
    33     permsdict = ss.deserialize_ertype_permissions(session)
    34 
    34 
    35     config.disabled_hooks_categories.add('integrity')
    35     changes = session.disable_hooks_category.add('integrity')
    36     for rschema in repo.schema.relations():
    36     for rschema in repo.schema.relations():
    37         rpermsdict = permsdict.get(rschema.eid, {})
    37         rpermsdict = permsdict.get(rschema.eid, {})
    38         for rdef in rschema.rdefs.values():
    38         for rdef in rschema.rdefs.values():
    39             for action in rdef.ACTIONS:
    39             for action in rdef.ACTIONS:
    40                 actperms = []
    40                 actperms = []
    70         'X relation_type RT, RT add_permission Y2, Y2 exprtype YET, '
    70         'X relation_type RT, RT add_permission Y2, Y2 exprtype YET, '
    71         'Y2 mainvars YMV, Y2 expression YEX')
    71         'Y2 mainvars YMV, Y2 expression YEX')
    72     for action in ('read', 'add', 'delete'):
    72     for action in ('read', 'add', 'delete'):
    73         drop_relation_definition('CWRType', '%s_permission' % action, 'CWGroup', commit=False)
    73         drop_relation_definition('CWRType', '%s_permission' % action, 'CWGroup', commit=False)
    74         drop_relation_definition('CWRType', '%s_permission' % action, 'RQLExpression')
    74         drop_relation_definition('CWRType', '%s_permission' % action, 'RQLExpression')
    75     config.disabled_hooks_categories.remove('integrity')
    75     if changes:
       
    76         session.enable_hooks_category.add(*changes)
    76 
    77 
    77 if applcubicwebversion < (3, 4, 0) and cubicwebversion >= (3, 4, 0):
    78 if applcubicwebversion < (3, 4, 0) and cubicwebversion >= (3, 4, 0):
    78 
    79 
    79     session.set_shared_data('do-not-insert-cwuri', True)
    80     session.set_shared_data('do-not-insert-cwuri', True)
    80     deactivate_verification_hooks()
    81     deactivate_verification_hooks()