LP#1862022: add more permissions to stock Acquisitions and Acq Admin profiles
authorGalen Charlton <gmc@equinoxinitiative.org>
Wed, 5 Feb 2020 00:52:25 +0000 (19:52 -0500)
committerBill Erickson <berickxx@gmail.com>
Thu, 3 Sep 2020 15:52:07 +0000 (11:52 -0400)
This patch makes the stock Acquisitions and Acquisitions Administrator
profiles better able to use the acquisitions modules out of the box.

The permissions added are:

Acquisitions Administrator Profile
-----------------------------------------
VIEW_FUND
VIEW_FUNDING_SOURCE
VIEW_FUND_ALLOCATION
VIEW_PICKLIST
VIEW_PROVIDER
VIEW_PURCHASE_ORDER
VIEW_INVOICE
CREATE_PICKLIST
ACQ_ADD_LINEITEM_IDENTIFIER
ACQ_SET_LINEITEM_IDENTIFIER
MANAGE_FUND
CREATE_INVOICE
CREATE_PURCHASE_ORDER
IMPORT_ACQ_LINEITEM_BIB_RECORD
IMPORT_ACQ_LINEITEM_BIB_RECORD_UPLOAD
MANAGE_CLAIM
MANAGE_PROVIDER
MANAGE_FUNDING_SOURCE
RECEIVE_PURCHASE_ORDER
ADMIN_ACQ_LINEITEM_ALERT_TEXT
UPDATE_FUNDING_SOURCE
UPDATE_PROVIDER
VIEW_IMPORT_MATCH_SET
VIEW_MERGE_PROFILE
IMPORT_MARC

Acquisitions Profile
-----------------------------------------
ACQ_ADD_LINEITEM_IDENTIFIER
ACQ_SET_LINEITEM_IDENTIFIER
ADMIN_ACQ_FUND
ADMIN_FUND
ACQ_INVOICE-REOPEN
ADMIN_ACQ_DISTRIB_FORMULA
ADMIN_INVOICE
IMPORT_ACQ_LINEITEM_BIB_RECORD_UPLOAD
VIEW_IMPORT_MATCH_SET
VIEW_MERGE_PROFILE

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Tiffany Little <tlittle@georgialibraries.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/YYYY.data.acq_permissions.sql [new file with mode: 0644]

index 7ddbde5..2543707 100644 (file)
@@ -2628,6 +2628,13 @@ INSERT INTO permission.grp_perm_map (grp, perm, depth, grantable)
                pgt.name = 'Acquisitions' AND
                aout.name = 'Consortium' AND
                perm.code IN (
+                       'ACQ_ADD_LINEITEM_IDENTIFIER',
+                       'ACQ_INVOICE-REOPEN',
+                       'ACQ_SET_LINEITEM_IDENTIFIER',
+                       'ADMIN_ACQ_FUND',
+                       'ADMIN_ACQ_DISTRIB_FORMULA',
+                       'ADMIN_FUND',
+                       'ADMIN_INVOICE',
                        'ALLOW_ALT_TCN',
                        'CLEAR_PURCHASE_REQUEST',
                        'CREATE_BIB_IMPORT_QUEUE',
@@ -2644,6 +2651,7 @@ INSERT INTO permission.grp_perm_map (grp, perm, depth, grantable)
                        'DELETE_VOLUME_NOTE',
                        'GENERAL_ACQ',
                        'IMPORT_ACQ_LINEITEM_BIB_RECORD',
+                       'IMPORT_ACQ_LINEITEM_BIB_RECORD_UPLOAD',
                        'IMPORT_MARC',
                        'MANAGE_CLAIM',
                        'MANAGE_FUND',
@@ -2686,6 +2694,8 @@ INSERT INTO permission.grp_perm_map (grp, perm, depth, grantable)
                        'VIEW_PICKLIST',
                        'VIEW_PROVIDER',
                        'VIEW_PURCHASE_ORDER',
+                       'VIEW_IMPORT_MATCH_SET',
+                       'VIEW_MERGE_PROFILE'
                        'VIEW_REPORT_OUTPUT');
 
 
@@ -2744,6 +2754,31 @@ INSERT INTO permission.grp_perm_map (grp, perm, depth, grantable)
                        'UPDATE_ACQ_FUNDING_SOURCE',
                        'UPDATE_INVOICE_ITEM_TYPE',
                        'UPDATE_INVOICE_METHOD',
+                       'VIEW_FUND',
+                       'VIEW_FUNDING_SOURCE',
+                       'VIEW_FUND_ALLOCATION',
+                       'VIEW_PICKLIST',
+                       'VIEW_PROVIDER',
+                       'VIEW_PURCHASE_ORDER',
+                       'VIEW_INVOICE',
+                       'CREATE_PICKLIST',
+                       'ACQ_ADD_LINEITEM_IDENTIFIER',
+                       'ACQ_SET_LINEITEM_IDENTIFIER',
+                       'MANAGE_FUND',
+                       'CREATE_INVOICE',
+                       'CREATE_PURCHASE_ORDER',
+                       'IMPORT_ACQ_LINEITEM_BIB_RECORD',
+                       'IMPORT_ACQ_LINEITEM_BIB_RECORD_UPLOAD',
+                       'MANAGE_CLAIM',
+                       'MANAGE_PROVIDER',
+                       'MANAGE_FUNDING_SOURCE',
+                       'RECEIVE_PURCHASE_ORDER',
+                       'ADMIN_ACQ_LINEITEM_ALERT_TEXT',
+                       'UPDATE_FUNDING_SOURCE',
+                       'UPDATE_PROVIDER',
+                       'VIEW_IMPORT_MATCH_SET',
+                       'VIEW_MERGE_PROFILE',
+                       'IMPORT_MARC',
                        'UPDATE_PICKLIST'
                );
 
diff --git a/Open-ILS/src/sql/Pg/upgrade/YYYY.data.acq_permissions.sql b/Open-ILS/src/sql/Pg/upgrade/YYYY.data.acq_permissions.sql
new file mode 100644 (file)
index 0000000..45e33fd
--- /dev/null
@@ -0,0 +1,65 @@
+BEGIN;
+
+INSERT INTO permission.grp_perm_map (grp, perm, depth, grantable)
+        SELECT
+                pgt.id, perm.id, aout.depth, TRUE
+        FROM
+                permission.grp_tree pgt,
+                permission.perm_list perm,
+                actor.org_unit_type aout
+        WHERE
+                pgt.name = 'Acquisitions Administrator' AND
+                aout.name = 'Consortium' AND
+                perm.code IN (
+                    'VIEW_FUND',
+                    'VIEW_FUNDING_SOURCE',
+                    'VIEW_FUND_ALLOCATION',
+                    'VIEW_PICKLIST',
+                    'VIEW_PROVIDER',
+                    'VIEW_PURCHASE_ORDER',
+                    'VIEW_INVOICE',
+                    'CREATE_PICKLIST',
+                    'ACQ_ADD_LINEITEM_IDENTIFIER',
+                    'ACQ_SET_LINEITEM_IDENTIFIER',
+                    'MANAGE_FUND',
+                    'CREATE_INVOICE',
+                    'CREATE_PURCHASE_ORDER',
+                    'IMPORT_ACQ_LINEITEM_BIB_RECORD',
+                    'IMPORT_ACQ_LINEITEM_BIB_RECORD_UPLOAD',
+                    'MANAGE_CLAIM',
+                    'MANAGE_PROVIDER',
+                    'MANAGE_FUNDING_SOURCE',
+                    'RECEIVE_PURCHASE_ORDER',
+                    'ADMIN_ACQ_LINEITEM_ALERT_TEXT',
+                    'UPDATE_FUNDING_SOURCE',
+                    'UPDATE_PROVIDER',
+                    'VIEW_IMPORT_MATCH_SET',
+                    'VIEW_MERGE_PROFILE',
+                    'IMPORT_MARC'
+                );
+
+
+INSERT INTO permission.grp_perm_map (grp, perm, depth, grantable)
+        SELECT
+                pgt.id, perm.id, aout.depth, FALSE
+        FROM
+                permission.grp_tree pgt,
+                permission.perm_list perm,
+                actor.org_unit_type aout
+        WHERE
+                pgt.name = 'Acquisitions' AND
+                aout.name = 'Consortium' AND
+                perm.code IN (
+                    'ACQ_ADD_LINEITEM_IDENTIFIER',
+                    'ACQ_SET_LINEITEM_IDENTIFIER',
+                    'ADMIN_ACQ_FUND',
+                    'ADMIN_FUND',
+                    'ACQ_INVOICE-REOPEN',
+                    'ADMIN_ACQ_DISTRIB_FORMULA',
+                    'ADMIN_INVOICE',
+                    'IMPORT_ACQ_LINEITEM_BIB_RECORD_UPLOAD',
+                    'VIEW_IMPORT_MATCH_SET',
+                    'VIEW_MERGE_PROFILE'
+                );
+
+COMMIT;