From d4bc67508ecd93b31fe1a9851567bc7cb8353769 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 16 Oct 2012 10:43:16 +0200 Subject: [PATCH] Bug 8438: Followup Set the superserials permission for all users with the claim_serials permission --- installer/data/mysql/updatedatabase.pl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 80ab210..2c2aa24 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -7912,6 +7912,15 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.15.00.XXX"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + my $borrowernumbers = $dbh->selectcol_arrayref("SELECT DISTINCT borrowernumber FROM user_permissions WHERE module_bit=15 AND code='claim_serials'"); + my $sth = $dbh->prepare("INSERT INTO user_permissions(borrowernumber, module_bit, code) VALUES (?, 15, 'superserials')"); + $sth->execute( $_ ) for @$borrowernumbers; + print "Upgrade to $DBversion done (Bug 8438 - Set the superserials permission for all users with the claim_serials permission.)\n"; + SetVersion ($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) -- 1.7.10.4