From e9b34fad1c8fa13902e79215ab3e3eb826a4915b 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 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 4653c02..ccdfaa0 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -9669,6 +9669,22 @@ if ( CheckVersion($DBversion) ) { SetVersion ($DBversion); } +$DBversion = "3.19.00.XXX"; +if ( CheckVersion($DBversion) ) { + my $borrowernumbers = $dbh->selectcol_arrayref(q| + SELECT DISTINCT borrowernumber + FROM user_permissions + WHERE module_bit=15 + AND code='claim_serials' + |); + my $sth = $dbh->prepare(q| + 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) -- 2.1.0