From e217a01ff458995a167760fde023c4293c213f9b Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 30 Aug 2022 10:16:44 -0300 Subject: [PATCH] Bug 31378: Add manage_authentication_providers permission Signed-off-by: Tomas Cohen Arazi --- installer/data/mysql/atomicupdate/bug_31378.pl | 9 +++++++++ installer/data/mysql/mandatory/userpermissions.sql | 1 + koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/installer/data/mysql/atomicupdate/bug_31378.pl b/installer/data/mysql/atomicupdate/bug_31378.pl index 66d796ddeb..915bd2fef9 100755 --- a/installer/data/mysql/atomicupdate/bug_31378.pl +++ b/installer/data/mysql/atomicupdate/bug_31378.pl @@ -8,6 +8,15 @@ return { my ($args) = @_; my ($dbh, $out) = @$args{qw(dbh out)}; + # Add new permission + $dbh->do(qq{ + INSERT IGNORE permissions (module_bit, code, description) + VALUES + ( 3, 'manage_authentication_providers', 'Manage authentication providers') + }); + + say $out "manage_authentication_providers permission added"; + unless (TableExists('auth_providers')) { $dbh->do(q{ CREATE TABLE `auth_providers` ( diff --git a/installer/data/mysql/mandatory/userpermissions.sql b/installer/data/mysql/mandatory/userpermissions.sql index a48c52373c..78d06a9f2f 100644 --- a/installer/data/mysql/mandatory/userpermissions.sql +++ b/installer/data/mysql/mandatory/userpermissions.sql @@ -41,6 +41,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 3, 'manage_background_jobs', 'Manage background jobs'), ( 3, 'manage_curbside_pickups', 'Manage curbside pickups'), ( 3, 'manage_search_filters', 'Manage custom search filters'), + ( 3, 'manage_authentication_providers', 'Manage authentication providers'), ( 4, 'delete_borrowers', 'Delete patrons'), ( 4, 'edit_borrowers', 'Add, modify and view patron information'), ( 4, 'view_borrower_infos_from_any_libraries', 'View patron infos from any libraries'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc index 51734c23a8..ca6b73e90e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc @@ -827,5 +827,11 @@ Manage recalls for patrons ([% name | html %]) + [%# authentication_providers %] + [%- CASE 'manage_authentication_providers' -%] + + Manage authentication providers + + ([% name | html %]) [%- END -%] [%- END -%] -- 2.25.1