Bugzilla – Attachment 161720 Details for
Bug 35953
Add delete_any_record cataloguing subpermission
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35953: Add delete_any_record cataloguing subpermission
Bug-35953-Add-deleteanyrecord-cataloguing-subpermi.patch (text/plain), 5.43 KB, created by
wainuiwitikapark
on 2024-02-02 01:52:25 UTC
(
hide
)
Description:
Bug 35953: Add delete_any_record cataloguing subpermission
Filename:
MIME Type:
Creator:
wainuiwitikapark
Created:
2024-02-02 01:52:25 UTC
Size:
5.43 KB
patch
obsolete
>From b27e1310bde9bbffe6bfa226843079e5a7b29f47 Mon Sep 17 00:00:00 2001 >From: root <root@wainuiwitikapark-lp.dynamic.wgtn.cat-it.co.nz> >Date: Fri, 2 Feb 2024 14:41:29 +1300 >Subject: [PATCH] Bug 35953: Add delete_any_record cataloguing subpermission > >To test: >- 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 are only 2 results >- 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 are 2 more options: "Edit record" and "Delete record" > >Sponsored-by: Education Services Australia SCIS >--- > .../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, 14 insertions(+), 3 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_35953_-_add_delete_any_record_permission.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_35953_-_add_delete_any_record_permission.perl b/installer/data/mysql/atomicupdate/bug_35953_-_add_delete_any_record_permission.perl >new file mode 100644 >index 00000000000..dd8fb1093af >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_35953_-_add_delete_any_record_permission.perl >@@ -0,0 +1,6 @@ >+i$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" ); >+} >diff --git a/installer/data/mysql/mandatory/userpermissions.sql b/installer/data/mysql/mandatory/userpermissions.sql >index 729c075548a..555bc6ad1e4 100644 >--- a/installer/data/mysql/mandatory/userpermissions.sql >+++ b/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'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc >index 8bae4385197..b01bf72659f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc >@@ -34,7 +34,7 @@ > <div class="btn-group"> > <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit <span class="caret"></span></button> > <ul class="dropdown-menu"> >- [% IF CAN_user_editcatalogue_edit_catalogue or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %] >+ [% IF CAN_user_editcatalogue_delete_any_record %] > <li><a id="editbiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber | html %]">Edit record</a></li> > [% END %] > >@@ -71,8 +71,8 @@ > <li><a id="duplicatebiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber | html %]&op=duplicate">Edit as new (duplicate)</a></li> > <li><a href="#" id="z3950copy">Replace record via Z39.50/SRU</a></li> > [% END %] >- >- [% IF CAN_user_editcatalogue_edit_catalogue or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %] >+ >+ [% IF CAN_user_editcatalogue_delete_any_record %] > [% IF ( count ) %] > <li class="disabled"><a id="deletebiblio" data-toggle="tooltip" data-placement="left" title="[% count | html %] item(s) are attached to this record. You must delete all items before deleting this record." href="#">Delete record</a></li> > [% ELSIF ( biblio.subscriptions.count ) %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >index 742e6e1c359..caa9aa2185e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >@@ -376,6 +376,10 @@ > <span class="sub_permission fast_cataloging_subpermission"> > Fast cataloging > </span> >+ [%- CASE 'delete_any_record' -%] >+ <span class="sub_permission delete_any_record_subpermission"> >+ Delete any existing record >+ </span> > <span class="permissioncode">([% name | html %])</span> > [%- CASE 'manage_item_groups' -%] > <span class="sub_permission manage_item_groups_subpermission"> >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35953
:
161720
|
161859
|
162129
|
162402