From a9827c3fc1bcebc0ab4913d736e2ba02fcd33622 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 9039766..0181f05 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -8074,6 +8074,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