38 if applcubicwebversion <= (3, 13, 0) and cubicwebversion >= (3, 13, 1): |
38 if applcubicwebversion <= (3, 13, 0) and cubicwebversion >= (3, 13, 1): |
39 sql('ALTER TABLE entities ADD asource VARCHAR(64)') |
39 sql('ALTER TABLE entities ADD asource VARCHAR(64)') |
40 sql('UPDATE entities SET asource=cw_name ' |
40 sql('UPDATE entities SET asource=cw_name ' |
41 'FROM cw_CWSource, cw_source_relation ' |
41 'FROM cw_CWSource, cw_source_relation ' |
42 'WHERE entities.eid=cw_source_relation.eid_from AND cw_source_relation.eid_to=cw_CWSource.cw_eid') |
42 'WHERE entities.eid=cw_source_relation.eid_from AND cw_source_relation.eid_to=cw_CWSource.cw_eid') |
|
43 |
|
44 if applcubicwebversion <= (3, 14, 0) and cubicwebversion >= (3, 14, 0): |
|
45 if 'require_permission' in schema and not 'localperms'in repo.config.cubes(): |
|
46 from cubicweb import ExecutionError |
|
47 try: |
|
48 add_cube('localperms', update_database=False) |
|
49 except ImportError: |
|
50 raise ExecutionError('In cubicweb 3.14, CWPermission and related stuff ' |
|
51 'has been moved to cube localperms. Install it first.') |
43 |
52 |
44 if applcubicwebversion == (3, 6, 0) and cubicwebversion >= (3, 6, 0): |
53 if applcubicwebversion == (3, 6, 0) and cubicwebversion >= (3, 6, 0): |
45 CSTRMAP = dict(rql('Any T, X WHERE X is CWConstraintType, X name T', |
54 CSTRMAP = dict(rql('Any T, X WHERE X is CWConstraintType, X name T', |
46 ask_confirm=False)) |
55 ask_confirm=False)) |
47 _add_relation_definition_no_perms('CWAttribute', 'update_permission', 'CWGroup') |
56 _add_relation_definition_no_perms('CWAttribute', 'update_permission', 'CWGroup') |