misc/migration/bootstrapmigration_repository.py
changeset 8696 0bb18407c053
parent 8694 d901c36bcfce
child 8800 8ca1a0da5a29
equal deleted inserted replaced
8695:358d8bed9626 8696:0bb18407c053
    74     permsdict = ss.deserialize_ertype_permissions(session)
    74     permsdict = ss.deserialize_ertype_permissions(session)
    75 
    75 
    76     with hooks_control(session, session.HOOKS_ALLOW_ALL, 'integrity'):
    76     with hooks_control(session, session.HOOKS_ALLOW_ALL, 'integrity'):
    77         for rschema in repo.schema.relations():
    77         for rschema in repo.schema.relations():
    78             rpermsdict = permsdict.get(rschema.eid, {})
    78             rpermsdict = permsdict.get(rschema.eid, {})
    79             for rdef in rschema.rdefs.values():
    79             for rdef in rschema.rdefs.itervalues():
    80                 for action in rdef.ACTIONS:
    80                 for action in rdef.ACTIONS:
    81                     actperms = []
    81                     actperms = []
    82                     for something in rpermsdict.get(action == 'update' and 'add' or action, ()):
    82                     for something in rpermsdict.get(action == 'update' and 'add' or action, ()):
    83                         if isinstance(something, tuple):
    83                         if isinstance(something, tuple):
    84                             actperms.append(rdef.rql_expression(*something))
    84                             actperms.append(rdef.rql_expression(*something))