From 50479d0909dfc291b9d84876dba4dc9104ced954 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 11 Jun 2020 12:48:00 +0200 Subject: [PATCH] Bug 22417: Add the new permission manage_background_jobs QA: Please answer the question in admin/background_jobs.pl Signed-off-by: Tomas Cohen Arazi Signed-off-by: David Cook --- admin/background_jobs.pl | 3 ++- installer/data/mysql/atomicupdate/bug_15032.perl | 6 ++++++ installer/data/mysql/userpermissions.sql | 1 + koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc | 5 +++++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/admin/background_jobs.pl b/admin/background_jobs.pl index 85dd740b40..9e08c70605 100755 --- a/admin/background_jobs.pl +++ b/admin/background_jobs.pl @@ -37,7 +37,8 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( query => $input, type => "intranet", authnotrequired => 0, - flagsrequired => { parameters => 'manage_background_jobs' }, # TODO Add this new permission, so far only works for superlibrarians + flagsrequired => { parameters => 'manage_background_jobs' }, # Maybe the "view" view should be accessible for the user who create this job. + # But in that case what could the permission to check here? tools => '*' ? debug => 1, } ); diff --git a/installer/data/mysql/atomicupdate/bug_15032.perl b/installer/data/mysql/atomicupdate/bug_15032.perl index 34554fc2f2..1c7eec4dbb 100644 --- a/installer/data/mysql/atomicupdate/bug_15032.perl +++ b/installer/data/mysql/atomicupdate/bug_15032.perl @@ -20,6 +20,12 @@ if( CheckVersion( $DBversion ) ) { |); } + $dbh->do(qq{ + INSERT IGNORE permissions (module_bit, code, description) + VALUES + (3, 'manage_background_jobs', 'Manage background jobs') + }); + SetVersion( $DBversion ); print "Upgrade to $DBversion done (Bug 15032 - Add new table background_jobs)\n"; } diff --git a/installer/data/mysql/userpermissions.sql b/installer/data/mysql/userpermissions.sql index 0224a56a79..38ef92e6c3 100644 --- a/installer/data/mysql/userpermissions.sql +++ b/installer/data/mysql/userpermissions.sql @@ -34,6 +34,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 3, 'manage_mana', 'Manage Mana KB content sharing'), ( 3, 'manage_additional_fields', 'Add, edit, or delete additional custom fields for baskets or subscriptions (also requires order_manage or edit_subscription permissions)'), ( 3, 'manage_keyboard_shortcuts', 'Manage keyboard shortcuts for the advanced cataloging editor'), + ( 3, 'manage_background_jobs', 'Manage background jobs'), ( 4, 'edit_borrowers', 'Add, modify and view patron information'), ( 4, 'view_borrower_infos_from_any_libraries', 'View patron infos from any libraries'), ( 6, 'place_holds', 'Place holds for patrons'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc index 79b6560193..baedc2917a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc @@ -255,6 +255,11 @@ Manage keyboard shortcuts for the advanced cataloging editor ([% name | html %]) + [%- CASE 'manage_background_jobs' -%] + + Manage background jobs + + ([% name | html %]) [%- CASE 'edit_borrowers' -%] Add, modify and view patron information -- 2.11.0