From aea63af24a491c516c5ff7dc273ba07987e3ebf0 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 15 Jul 2022 16:54:03 +0100 Subject: [PATCH] Bug 30335: (follow-up) Add permissions for manual accounts options This patch adds two new sub-permissions, `manual_credit` and `manual_invoice` to allow/prevent staff the ability to add manual invoices and credits to a patrons account. Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- installer/data/mysql/atomicupdate/bug_30335.pl | 15 +++++++++++++++ .../data/mysql/mandatory/userpermissions.sql | 2 ++ .../prog/en/includes/permissions.inc | 10 ++++++++++ 3 files changed, 27 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_30335.pl diff --git a/installer/data/mysql/atomicupdate/bug_30335.pl b/installer/data/mysql/atomicupdate/bug_30335.pl new file mode 100644 index 0000000000..3afb3b2148 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_30335.pl @@ -0,0 +1,15 @@ +use Modern::Perl; + +return { + bug_number => "30335", + description => "Add manual_invoice and manual_credit permissions", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + $dbh->do(q{ + INSERT IGNORE permissions (module_bit, code, description) VALUES + (10, 'manual_credit', 'Add manual credits to a patron account'), + (10, 'manual_invoice', 'Add manual invoices to a patron account') + }); + }, +}; diff --git a/installer/data/mysql/mandatory/userpermissions.sql b/installer/data/mysql/mandatory/userpermissions.sql index a291f6dc6b..44cf013bfd 100644 --- a/installer/data/mysql/mandatory/userpermissions.sql +++ b/installer/data/mysql/mandatory/userpermissions.sql @@ -58,6 +58,8 @@ INSERT INTO permissions (module_bit, code, description) VALUES (10, 'refund', 'Perform account refund action'), (10, 'discount', 'Perform account discount action'), (10, 'writeoff', 'Write off fines and fees'), + (10, 'manual_credit', 'Add manual credits to a patron account'), + (10, 'manual_invoice', 'Add manual invoices to a patron account'), (10, 'remaining_permissions', 'Remaining permissions for managing fines and fees'), (11, 'currencies_manage', 'Manage currencies and exchange rates'), (11, 'vendors_manage', 'Manage vendors'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc index dc1c309bba..917f228a4c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc @@ -378,6 +378,16 @@ Write off fines and fees ([% name | html %]) + [%- CASE 'manual_invoice' -%] + + Add manual invoices to a patron account + + ([% name | html %]) + [%- CASE 'manual_credit' -%] + + Add manual credits to a patron account + + ([% name | html %]) [%- CASE 'suggestions_manage' -%] Manage purchase suggestions -- 2.39.5