@@ -, +, @@ - apply patch - create a new test user - give the test user "catalogue" permissions so that they can enter the staff interface - also give the test user the "edit_catalogue" subpermission under the "editcatalogue" permission - login to the staff interface as the test user - do a catalogue search - click on a result and go to their biblio details page - notice there is an "Edit" button dropdown - click on the "Edit" button dropdown and notice there is no option to "Delete record" - change the permissions of the test user to also have "delete_any_record" subpermission under the "editcatalogue" permission - do another catalogue search and click on the result - click on the "Edit" button dropdown and notice there is now an option to "Delete record" --- .../bug_35953_-_add_delete_any_record_permission.perl | 6 ++++++ installer/data/mysql/mandatory/userpermissions.sql | 1 + koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc | 6 ++++++ koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc | 4 ++++ 4 files changed, 17 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_35953_-_add_delete_any_record_permission.perl --- a/installer/data/mysql/atomicupdate/bug_35953_-_add_delete_any_record_permission.perl +++ a/installer/data/mysql/atomicupdate/bug_35953_-_add_delete_any_record_permission.perl @@ -0,0 +1,6 @@ +$DBversion = 'XXX'; +if( CheckVersion( $DBversion ) ) { + $dbh->do(q{INSERT IGNORE INTO permissions (module_bit, code, description) VALUES (9, 'delete_any_record', 'Delete any existing record')}); + + NewVersion( $DBversion, undef, "Add delete_any_record user permission" ); +} --- a/installer/data/mysql/mandatory/userpermissions.sql +++ a/installer/data/mysql/mandatory/userpermissions.sql @@ -59,6 +59,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 9, 'delete_all_items', 'Delete all items at once'), ( 9, 'manage_item_groups', 'Create, update and delete item groups, add or remove items from a item groups'), ( 9, 'manage_item_editor_templates', 'Update and delete item editor template owned by others'), + ( 9, 'delete_any_record', 'Delete any existing record'), ( 9, 'edit_any_item', 'Edit any item regardless of home library'), (10, 'payout', 'Perform account payout action'), (10, 'refund', 'Perform account refund action'), --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc @@ -75,11 +75,17 @@ [% IF CAN_user_editcatalogue_edit_catalogue or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %] [% IF ( count ) %] + [% IF CAN_user_editcatalogue_delete_any_record %]
  • Delete record
  • + [% END %] [% ELSIF ( biblio.subscriptions.count ) %] + [% IF CAN_user_editcatalogue_delete_any_record %]
  • Delete record
  • + [% END %] [% ELSE %] + [% IF CAN_user_editcatalogue_delete_any_record %]
  • Delete record
  • + [% END %] [% END %] [% END %] --- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc @@ -376,6 +376,10 @@ Fast cataloging + [%- CASE 'delete_any_record' -%] + + Delete any existing record + ([% name | html %]) [%- CASE 'manage_item_groups' -%] --