( 562, 'ADMIN_TAG_TABLE', oils_i18n_gettext( 562,
'Allow administration of MARC tag tables', 'ppl', 'description' )),
( 563, 'ADJUST_BILLS', oils_i18n_gettext( 563,
- 'Allow a user to adjust a bill (generally to zero)', 'ppl', 'description' ))
+ 'Allow a user to adjust a bill (generally to zero)', 'ppl', 'description' )),
+ ( 564, 'MARK_ITEM_CATALOGING', oils_i18n_gettext( 564,
+ 'Allow a user to mark an item status as ''cataloging''', 'ppl', 'description' )),
+ ( 565, 'MARK_ITEM_DAMAGED', oils_i18n_gettext( 565,
+ 'Allow a user to mark an item status as ''damaged''', 'ppl', 'description' )),
+ ( 566, 'MARK_ITEM_DISCARD', oils_i18n_gettext( 566,
+ 'Allow a user to mark an item status as ''discard''', 'ppl', 'description' )),
+ ( 567, 'MARK_ITEM_RESERVES', oils_i18n_gettext( 567,
+ 'Allow a user to mark an item status as ''reserves''', 'ppl', 'description' )),
+ ( 568, 'ADMIN_ORG_UNIT_SETTING_TYPE_LOG', oils_i18n_gettext( 568,
+ 'Allow a user to modify the org unit settings log', 'ppl', 'description' )),
+ ( 570, 'CREATE_POP_BADGE', oils_i18n_gettext( 570,
+ 'Allow a user to create a new popularity badge', 'ppl', 'description' )),
+ ( 571, 'DELETE_POP_BADGE', oils_i18n_gettext( 571,
+ 'Allow a user to delete a popularity badge', 'ppl', 'description' )),
+ ( 572, 'UPDATE_POP_BADGE', oils_i18n_gettext( 572,
+ 'Allow a user to modify a popularity badge', 'ppl', 'description' )),
+ ( 573, 'CREATE_POP_PARAMETER', oils_i18n_gettext( 573,
+ 'Allow a user to create a popularity badge parameter', 'ppl', 'description' )),
+ ( 574, 'DELETE_POP_PARAMETER', oils_i18n_gettext( 574,
+ 'Allow a user to delete a popularity badge parameter', 'ppl', 'description' )),
+ ( 575, 'UPDATE_POP_PARAMETER', oils_i18n_gettext( 575,
+ 'Allow a user to modify a popularity badge parameter', 'ppl', 'description' )),
+ ( 576, 'CREATE_AUTHORITY_RECORD', oils_i18n_gettext( 576,
+ 'Allow a user to create an authority record', 'ppl', 'description' )),
+ ( 577, 'DELETE_AUTHORITY_RECORD', oils_i18n_gettext( 577,
+ 'Allow a user to delete an authority record', 'ppl', 'description' )),
+ ( 578, 'UPDATE_AUTHORITY_RECORD', oils_i18n_gettext( 578,
+ 'Allow a user to modify an authority record', 'ppl', 'description' )),
+ ( 579, 'CREATE_AUTHORITY_CONTROL_SET', oils_i18n_gettext( 579,
+ 'Allow a user to create an authority control set', 'ppl', 'description' )),
+ ( 580, 'DELETE_AUTHORITY_CONTROL_SET', oils_i18n_gettext( 580,
+ 'Allow a user to delete an authority control set', 'ppl', 'description' )),
+ ( 581, 'UPDATE_AUTHORITY_CONTROL_SET', oils_i18n_gettext( 581,
+ 'Allow a user to modify an authority control set', 'ppl', 'description' )),
+ ( 582, 'ACTOR_USER_DELETE_OPEN_XACTS.override', oils_i18n_gettext( 582,
+ 'Override the ACTOR_USER_DELETE_OPEN_XACTS event', 'ppl', 'description' )),
+ ( 583, 'PATRON_EXCEEDS_LOST_COUNT.override', oils_i18n_gettext( 583,
+ 'Override the PATRON_EXCEEDS_LOST_COUNT event', 'ppl', 'description' )),
+ ( 584, 'MAX_HOLDS.override', oils_i18n_gettext( 584,
+ 'Override the MAX_HOLDS event', 'ppl', 'description' )),
+ ( 585, 'ITEM_DEPOSIT_REQUIRED.override', oils_i18n_gettext( 585,
+ 'Override the ITEM_DEPOSIT_REQUIRED event', 'ppl', 'description' )),
+ ( 586, 'ITEM_DEPOSIT_PAID.override', oils_i18n_gettext( 586,
+ 'Override the ITEM_DEPOSIT_PAID event', 'ppl', 'description' )),
+ ( 587, 'COPY_STATUS_LOST_AND_PAID.override', oils_i18n_gettext( 587,
+ 'Override the COPY_STATUS_LOST_AND_PAID event', 'ppl', 'description' )),
+ ( 588, 'ITEM_NOT_HOLDABLE.override', oils_i18n_gettext( 588,
+ 'Override the ITEM_NOT_HOLDABLE event', 'ppl', 'description' )),
+ ( 589, 'ITEM_RENTAL_FEE_REQUIRED.override', oils_i18n_gettext( 589,
+ 'Override the ITEM_RENTAL_FEE_REQUIRED event', 'ppl', 'description' ))
;
SELECT SETVAL('permission.perm_list_id_seq'::TEXT, 1000);
'UPDATE_MARC',
'UPDATE_RECORD',
'user_request.view',
- 'VIEW_AUTHORITY_RECORD_NOTES');
+ 'VIEW_AUTHORITY_RECORD_NOTES',
+ 'CREATE_AUTHORITY_RECORD',
+ 'DELETE_AUTHORITY_RECORD',
+ 'UPDATE_AUTHORITY_RECORD');
INSERT INTO permission.grp_perm_map (grp, perm, depth, grantable)
SELECT
'UPDATE_MFHD_RECORD',
'UPDATE_VOLUME',
'UPDATE_VOLUME_NOTE',
- 'VIEW_SERIAL_SUBSCRIPTION');
+ 'VIEW_SERIAL_SUBSCRIPTION',
+ 'MARK_ITEM_CATALOGING',
+ 'MARK_ITEM_DAMAGED',
+ 'MARK_ITEM_DISCARD',
+ 'MARK_ITEM_RESERVES',
+ '',
+ '',
+ '');
-- Add advanced cataloguing permissions to the Cataloging Admin group
'UPDATE_MERGE_PROFILE',
'UPDATE_MONOGRAPH_PART',
'UPDATE_VOLUME_PREFIX',
- 'UPDATE_VOLUME_SUFFIX'
- );
+ 'UPDATE_VOLUME_SUFFIX',
+ 'CREATE_AUTHORITY_CONTROL_SET',
+ 'DELETE_AUTHORITY_CONTROL_SET',
+ 'UPDATE_AUTHORITY_CONTROL_SET');
INSERT INTO permission.grp_perm_map (grp, perm, depth, grantable)
SELECT
'UPDATE_COPY_LOCATION',
'UPDATE_COPY_STAT_CAT',
'UPDATE_COPY_STAT_CAT_ENTRY',
- 'VIEW_REPORT_OUTPUT');
+ 'VIEW_REPORT_OUTPUT'
+ 'CREATE_POP_BADGE',
+ 'DELETE_POP_BADGE',
+ 'UPDATE_POP_BADGE',
+ 'CREATE_POP_PARAMETER',
+ 'DELETE_POP_PARAMETER',
+ 'UPDATE_POP_PARAMETER');
-- Add basic circulation permissions to the Circulators group
'VIEW_STANDING_PENALTY',
'VOID_BILLING',
'TRANSIT_CHECKIN_INTERVAL_BLOCK.override',
- 'VOLUME_HOLDS');
+ 'VOLUME_HOLDS',
+ 'ACTOR_USER_DELETE_OPEN_XACTS.override',
+ 'PATRON_EXCEEDS_LOST_COUNT.override',
+ 'MAX_HOLDS.override',
+ 'ITEM_DEPOSIT_REQUIRED.override',
+ 'ITEM_RENTAL_FEE_REQUIRED.override',
+ 'ITEM_DEPOSIT_PAID.override',
+ 'COPY_STATUS_LOST_AND_PAID.override',
+ 'ITEM_NOT_HOLDABLE.override');
-- Add basic sys admin permissions to the Local Administrator group
--- /dev/null
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+-- Add missing permissions noted in LP 1517137 adjusting those added manually and ignoring those already in place.
+
+DO $$
+DECLARE fixperm TEXT[3];
+DECLARE modify BOOLEAN;
+DECLARE permid BIGINT;
+DECLARE oldid BIGINT;
+BEGIN
+
+FOREACH fixperm SLICE 1 IN ARRAY ARRAY[
+ ['564', 'MARK_ITEM_CATALOGING', 'Allow a user to mark an item status as ''cataloging'''],
+ ['565', 'MARK_ITEM_DAMAGED', 'Allow a user to mark an item status as ''damaged'''],
+ ['566', 'MARK_ITEM_DISCARD', 'Allow a user to mark an item status as ''discard'''],
+ ['567', 'MARK_ITEM_RESERVES', 'Allow a user to mark an item status as ''reserves'''],
+ ['568', 'ADMIN_ORG_UNIT_SETTING_TYPE_LOG', 'Allow a user to modify the org unit settings log'],
+ ['570', 'CREATE_POP_BADGE', 'Allow a user to create a new popularity badge'],
+ ['571', 'DELETE_POP_BADGE', 'Allow a user to delete a popularity badge'],
+ ['572', 'UPDATE_POP_BADGE', 'Allow a user to modify a popularity badge'],
+ ['573', 'CREATE_POP_PARAMETER', 'Allow a user to create a popularity badge parameter'],
+ ['574', 'DELETE_POP_PARAMETER', 'Allow a user to delete a popularity badge parameter'],
+ ['575', 'UPDATE_POP_PARAMETER', 'Allow a user to modify a popularity badge parameter'],
+ ['576', 'CREATE_AUTHORITY_RECORD', 'Allow a user to create an authority record'],
+ ['577', 'DELETE_AUTHORITY_RECORD', 'Allow a user to delete an authority record'],
+ ['578', 'UPDATE_AUTHORITY_RECORD', 'Allow a user to modify an authority record'],
+ ['579', 'CREATE_AUTHORITY_CONTROL_SET', 'Allow a user to create an authority control set'],
+ ['580', 'DELETE_AUTHORITY_CONTROL_SET', 'Allow a user to delete an authority control set'],
+ ['581', 'UPDATE_AUTHORITY_CONTROL_SET', 'Allow a user to modify an authority control set'],
+ ['582', 'ACTOR_USER_DELETE_OPEN_XACTS.override', 'Override the ACTOR_USER_DELETE_OPEN_XACTS event'],
+ ['583', 'PATRON_EXCEEDS_LOST_COUNT.override', 'Override the PATRON_EXCEEDS_LOST_COUNT event'],
+ ['584', 'MAX_HOLDS.override', 'Override the MAX_HOLDS event'],
+ ['585', 'ITEM_DEPOSIT_REQUIRED.override', 'Override the ITEM_DEPOSIT_REQUIRED event'],
+ ['586', 'ITEM_DEPOSIT_PAID.override', 'Override the ITEM_DEPOSIT_PAID event'],
+ ['587', 'COPY_STATUS_LOST_AND_PAID.override', 'Override the COPY_STATUS_LOST_AND_PAID event'],
+ ['588', 'ITEM_NOT_HOLDABLE.override', 'Override the ITEM_NOT_HOLDABLE event'],
+ ['589', 'ITEM_RENTAL_FEE_REQUIRED.override', 'Override the ITEM_RENTAL_FEE_REQUIRED event']
+]
+LOOP
+ permid := CAST (fixperm[1] AS BIGINT);
+ -- Has this permission already been manually applied at the expected id?
+ PERFORM * FROM permission.perm_list WHERE id = permid;
+ IF NOT FOUND THEN
+ UPDATE permission.perm_list SET code = code || '_local' WHERE code = fixperm[2] AND id > 1000 RETURNING id INTO oldid;
+ modify := FOUND;
+
+ INSERT INTO permission.perm_list (id, code, description) VALUES (permid, fixperm[2], fixperm[3]);
+
+ -- Several of these are rather unlikely for these particular permissions but safer > sorry.
+ IF modify THEN
+ UPDATE permission.grp_perm_map SET perm = permid WHERE perm = oldid;
+ UPDATE config.org_unit_setting_type SET update_perm = permid WHERE update_perm = oldid;
+ UPDATE permission.usr_object_perm_map SET perm = permid WHERE perm = oldid;
+ UPDATE permission.usr_perm_map SET perm = permid WHERE perm = oldid;
+ UPDATE config.org_unit_setting_type SET view_perm = permid WHERE view_perm = oldid;
+ UPDATE config.z3950_source SET use_perm = permid WHERE use_perm = oldid;
+ DELETE FROM permission.perm_list WHERE id = oldid;
+ END IF;
+ END IF;
+END LOOP;
+
+END$$;
+
+COMMIT;