Bug 39848: Restrict record deletion to staff who have edit_catalogue permission

To test,
1. Create a user with the following permissions: edit_any_item, edit_items, items_batchdel, items_batchmod.
2. When logged in as that user, use the batch item deletion tool to delete a few items.
3. Select “Delete records if no items remain” and “Delete selected items.”
When the job has processed, notice that X item(s) deleted. X record(s) deleted.
4. APPLY PATCH
5. With the same user repeat step 2.
6. This time there should be no option to 'Delete records if no items remain'.
7. Give the same use the Edit catalog (Modify bibliographic/holdings data) (edit_catalogue) permission.
8. Make sure you can successfully delete a record using the 'Delete records if no items remain'.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 0f70ec68c9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Lucas Gass 2025-05-06 22:19:40 +00:00 committed by Fridolin Somers
parent ebf2ec8553
commit 180e54a871
No known key found for this signature in database
GPG Key ID: 9A8E73E2A8B96537
1 changed files with 4 additions and 1 deletions

View File

@ -170,7 +170,10 @@
<input type="hidden" name="op" value="[% op | html %]" />
<p>This will delete [% IF ( too_many_items_display ) %]all the[% ELSE %]the selected[% END %] items.</p>
<input type="hidden" name="del" value="1" />
<input type="checkbox" name="del_records" id="del_records" /> <label for="del_records">Delete records if no items remain.</label>
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
<input type="checkbox" name="del_records" id="del_records" />
<label for="del_records">Delete records if no items remain.</label>
[% END %]
<fieldset class="action">
[% IF too_many_items_display %]