@@ -, +, @@
---
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(-)
--- a/admin/background_jobs.pl
+++ a/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,
}
);
--- a/installer/data/mysql/atomicupdate/bug_15032.perl
+++ a/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";
}
--- a/installer/data/mysql/userpermissions.sql
+++ a/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'),
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc
+++ a/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
--