From 76a141c5416603dd235b2e53bdcf569a01a11f53 Mon Sep 17 00:00:00 2001 From: Laura_Escamilla Date: Mon, 22 Jul 2024 17:10:21 +0000 Subject: [PATCH] Bug 37144: Atomic update --- .../data/mysql/atomicupdate/bug_37144.pl | 26 +++++++++++++++++++ 1 file changed, 26 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..91e195e081 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_37144.pl @@ -0,0 +1,26 @@ +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