LP1850547 Stamping DB upgrade: Ang Acq Search
[Evergreen.git] / Open-ILS / src / sql / Pg / upgrade / 1218.data.acq_permissions.sql
1 BEGIN;
2
3 SELECT evergreen.upgrade_deps_block_check('1218', :eg_version);
4
5 INSERT INTO permission.grp_perm_map (grp, perm, depth, grantable)
6         SELECT
7                 pgt.id, perm.id, aout.depth, TRUE
8         FROM
9                 permission.grp_tree pgt,
10                 permission.perm_list perm,
11                 actor.org_unit_type aout
12         WHERE
13                 pgt.name = 'Acquisitions Administrator' AND
14                 aout.name = 'Consortium' AND
15                 perm.code IN (
16                     'VIEW_FUND',
17                     'VIEW_FUNDING_SOURCE',
18                     'VIEW_FUND_ALLOCATION',
19                     'VIEW_PICKLIST',
20                     'VIEW_PROVIDER',
21                     'VIEW_PURCHASE_ORDER',
22                     'VIEW_INVOICE',
23                     'CREATE_PICKLIST',
24                     'ACQ_ADD_LINEITEM_IDENTIFIER',
25                     'ACQ_SET_LINEITEM_IDENTIFIER',
26                     'MANAGE_FUND',
27                     'CREATE_INVOICE',
28                     'CREATE_PURCHASE_ORDER',
29                     'IMPORT_ACQ_LINEITEM_BIB_RECORD',
30                     'IMPORT_ACQ_LINEITEM_BIB_RECORD_UPLOAD',
31                     'MANAGE_CLAIM',
32                     'MANAGE_PROVIDER',
33                     'MANAGE_FUNDING_SOURCE',
34                     'RECEIVE_PURCHASE_ORDER',
35                     'ADMIN_ACQ_LINEITEM_ALERT_TEXT',
36                     'UPDATE_FUNDING_SOURCE',
37                     'UPDATE_PROVIDER',
38                     'VIEW_IMPORT_MATCH_SET',
39                     'VIEW_MERGE_PROFILE',
40                     'IMPORT_MARC'
41                 );
42
43
44 INSERT INTO permission.grp_perm_map (grp, perm, depth, grantable)
45         SELECT
46                 pgt.id, perm.id, aout.depth, FALSE
47         FROM
48                 permission.grp_tree pgt,
49                 permission.perm_list perm,
50                 actor.org_unit_type aout
51         WHERE
52                 pgt.name = 'Acquisitions' AND
53                 aout.name = 'Consortium' AND
54                 perm.code IN (
55                     'ACQ_ADD_LINEITEM_IDENTIFIER',
56                     'ACQ_SET_LINEITEM_IDENTIFIER',
57                     'ADMIN_ACQ_FUND',
58                     'ADMIN_FUND',
59                     'ACQ_INVOICE-REOPEN',
60                     'ADMIN_ACQ_DISTRIB_FORMULA',
61                     'ADMIN_INVOICE',
62                     'IMPORT_ACQ_LINEITEM_BIB_RECORD_UPLOAD',
63                     'VIEW_IMPORT_MATCH_SET',
64                     'VIEW_MERGE_PROFILE'
65                 );
66
67 COMMIT;