From 1432ebe76c3f2d5b3c73a76930a2ba2337a42cf3 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 Signed-off-by: Lukasz Koszyk --- 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 44cf013bfd..1c90d83f5c 100644 --- a/installer/data/mysql/mandatory/userpermissions.sql +++ b/installer/data/mysql/mandatory/userpermissions.sql @@ -40,6 +40,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 3, 'manage_smtp_servers', 'Manage SMTP servers configuration'), ( 3, 'manage_background_jobs', 'Manage background jobs'), ( 3, 'manage_curbside_pickups', 'Manage curbside pickups'), + ( 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 917f228a4c..e364ddef62 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc @@ -822,5 +822,11 @@ Manage recalls for patrons ([% name | html %]) + [%# authentication_providers %] + [%- CASE 'manage_authentication_providers' -%] + + Manage authentication providers + + ([% name | html %]) [%- END -%] [%- END -%] -- 2.20.1