From bcf690e69e5e2067146b4a723c908baf86a7ff17 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 15 Jun 2022 10:03:28 +0200 Subject: [PATCH] Bug 30650: Split the permission We actually want one permission to manage the administration page, and one for the circulation module. Signed-off-by: Koha Team University Lyon 3 Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- circ/curbside_pickups.pl | 2 +- installer/data/mysql/atomicupdate/bug_30650.pl | 7 ++++++- installer/data/mysql/mandatory/userpermissions.sql | 1 + .../intranet-tmpl/prog/en/modules/circ/circulation-home.tt | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/circ/curbside_pickups.pl b/circ/curbside_pickups.pl index e3223e3dc8..1de97f9c84 100755 --- a/circ/curbside_pickups.pl +++ b/circ/curbside_pickups.pl @@ -38,7 +38,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( template_name => "circ/curbside_pickups.tt", query => $input, type => "intranet", - flagsrequired => { parameters => 'manage_curbside_pickups' }, + flagsrequired => { circulate => 'manage_curbside_pickups' }, } ); diff --git a/installer/data/mysql/atomicupdate/bug_30650.pl b/installer/data/mysql/atomicupdate/bug_30650.pl index 068b29d66c..53015d2c43 100755 --- a/installer/data/mysql/atomicupdate/bug_30650.pl +++ b/installer/data/mysql/atomicupdate/bug_30650.pl @@ -171,7 +171,12 @@ return { $dbh->do(qq{ INSERT IGNORE permissions (module_bit, code, description) VALUES - (3, 'manage_curbside_pickups', 'Manage curbside pickups') + (1, 'manage_curbside_pickups', 'Manage curbside pickups (circulation)') + }); + $dbh->do(qq{ + INSERT IGNORE permissions (module_bit, code, description) + VALUES + (3, 'manage_curbside_pickups', 'Manage curbside pickups (admin)') }); unless ( column_exists('curbside_pickup_policy', 'enable_waiting_holds_only') ) { diff --git a/installer/data/mysql/mandatory/userpermissions.sql b/installer/data/mysql/mandatory/userpermissions.sql index b8037d162e..612d17233f 100644 --- a/installer/data/mysql/mandatory/userpermissions.sql +++ b/installer/data/mysql/mandatory/userpermissions.sql @@ -5,6 +5,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 1, 'force_checkout', 'Force checkout if a limitation exists'), ( 1, 'manage_restrictions', 'Manage restrictions for accounts'), ( 1, 'manage_checkout_notes', 'Mark checkout notes as seen/not seen'), + ( 1, 'manage_curbside_pickups', 'Manage curbside pickups'), ( 3, 'parameters_remaining_permissions', 'Remaining system parameters permissions'), ( 3, 'manage_accounts', 'Manage Account Debit and Credit Types' ), ( 3, 'manage_circ_rules', 'Manage circulation rules'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt index c8732dbe9a..bbdfb78873 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt @@ -83,7 +83,7 @@
  • Holds awaiting pickup
  • - [% IF ( Koha.Preference('CurbsidePickup') && CAN_user_parameters_manage_curbside_pickups ) %] + [% IF ( Koha.Preference('CurbsidePickup') && CAN_user_circulate_manage_curbside_pickups ) %]
  • Curbside Pickups
  • -- 2.39.5