From fe191c9c4325362bf879cbe8d3fcc3e0f99d355e Mon Sep 17 00:00:00 2001 From: Laura_Escamilla Date: Wed, 3 Jul 2024 14:37:50 +0000 Subject: [PATCH] Bug 37144: Atomic update --- .../data/mysql/atomicupdate/bug_37144.pl | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_37144.pl diff --git a/installer/data/mysql/atomicupdate/bug_37144.pl b/installer/data/mysql/atomicupdate/bug_37144.pl new file mode 100644 index 0000000000..a99c03b7dd --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_37144.pl @@ -0,0 +1,25 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_failure say_success say_info); + +return { + bug_number => "BUG_37144", + description => "Add a subpermission for hiding patron contact information", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + # Do you stuffs here + $dbh->do(q{ + INSERT IGNORE permissions (module_bit, code, description) VALUES (4, 'view_contact_information', 'View patron contact information') + }); + + $dbh->do(q{ + INSERT IGNORE INTO user_permissions (borrowernumber, module_bit, code) + SELECT borrowernumber, 4, 'view_contact_information' FROM borrowers WHERE borrowernumber IN ( SELECT borrowernumber FROM user_permissions WHERE code = 'edit_borrowers') + }); + + # permissions + say $out "Added new permission 'view_contact_information'"; + + }, +}; -- 2.39.2