From 67cc4ca302ec377bd145824a807857dcc40b893a Mon Sep 17 00:00:00 2001 From: Fridolyn SOMERS Date: Thu, 7 Mar 2013 12:17:33 -0500 Subject: [PATCH] Bug 6898 - circulation librarians can't run overdues without reports permissions followup Better update database. Signed-off-by: Kyle M Hall Signed-off-by: Jonathan Druart Signed-off-by: Jared Camins-Esakov --- installer/data/mysql/updatedatabase.pl | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 90019ff39b..1779aa22d3 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -6488,7 +6488,19 @@ if ( CheckVersion($DBversion) ) { $DBversion = "3.11.00.XXX"; if ( CheckVersion($DBversion) ) { - $dbh->do("INSERT INTO permissions ( module_bit, code, description ) VALUES ( '1', 'overdues_report', 'Execute overdue items report' )"); + $dbh->do(q{ + INSERT INTO permissions ( module_bit, code, description ) + VALUES ( '1', 'overdues_report', 'Execute overdue items report' ) + }); + # add new permission for users with all report permissions and circulation remaining permission + my $sth = $dbh->prepare(q{ + INSERT INTO user_permissions (borrowernumber, module_bit, code) + SELECT user_permissions.borrowernumber, 1, 'overdues_report' + FROM user_permissions + LEFT JOIN borrowers USING(borrowernumber) + WHERE borrowers.flags & (1 << 16) + AND user_permissions.code = 'circulate_remaining_permissions' + }); print "Upgrade to $DBversion done ( Add circ permission overdues_report )\n"; SetVersion($DBversion); } -- 2.39.5