From 2a4b81ea528911a50cc2a30339c8154b584621a1 Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Mon, 1 Aug 2016 19:38:10 -0400 Subject: [PATCH] Bug 16978: Followup - Copy create_report permissions for delete_report This patch should deal with comment #6's point of where a user who has create, but not execute permissions, would lose delete ability. Users with create and execute permissions would already have delete as well. TEST PLAN --------- 1) Back up db 2) drop database koha_library; 3) create database koha_library; 4) web install with all sample data with system user 6) log into staff client as system user 7) make sample koha admin user a superlibrarian 8) set username and password for sample koha admin user 9) log out and log in as koha admin 10) Create a user (USER_A) with permissions: create_reports and execute_reports. 11) Create a user (USER_B) with permissions: create_reports, but not execute_reports. 12) Create a user (USER_C) with permissions: execute_reports, but not create_reports. 13) Create a user (USER_D) with no report permissions. 14) Run the atomic update. 15) Check USER_A permissions -- should have delete_reports 16) Check USER_B -- should have delete_reports 17) Check USER_C -- should NOT have delete_reports 18) Check USER_D -- should NOT have delete_reports 19) run koha qa test tools 20) restore db --- installer/data/mysql/atomicupdate/bug_16978.sql | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/installer/data/mysql/atomicupdate/bug_16978.sql b/installer/data/mysql/atomicupdate/bug_16978.sql index 6d15c21..4ee70f0 100644 --- a/installer/data/mysql/atomicupdate/bug_16978.sql +++ b/installer/data/mysql/atomicupdate/bug_16978.sql @@ -1,3 +1,9 @@ INSERT IGNORE INTO `permissions` (module_bit, code, description) VALUES (16, 'delete_reports', 'Delete SQL reports'); + +INSERT IGNORE INTO user_permissions + (borrowernumber, module_bit,code) + SELECT borrowernumber,module_bit,'delete_reports' + FROM user_permissions + WHERE module_bit=16 AND code='create_reports'; -- 2.1.4