Bug 30335: (follow-up) Ensure existing users remain permitted

This patch updates the database update to ensure users with the
'remaining_permissions' subpermission of 'updatecharges' continue to be
able to manually invoice and manually credit borrower accounts after the
patch is applied.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Martin Renvoize 2022-07-15 17:21:13 +01:00 committed by Tomas Cohen Arazi
parent 2954fbc9cc
commit 1bbc53f65f
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 13 additions and 3 deletions

View File

@ -1,15 +1,25 @@
use Modern::Perl;
return {
bug_number => "30335",
bug_number => "30335",
description => "Add manual_invoice and manual_credit permissions",
up => sub {
up => sub {
my ($args) = @_;
my ($dbh, $out) = @$args{qw(dbh out)};
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')
});
$dbh->do(q{
INSERT IGNORE INTO user_permissions (borrowernumber, module_bit, code)
SELECT borrowernumber, 10, 'manual_credit' FROM user_permissions WHERE code = 'remaining_permissions'
});
$dbh->do(q{
INSERT IGNORE INTO user_permissions (borrowernumber, module_bit, code)
SELECT borrowernumber, 10, 'manual_invoice' FROM user_permissions WHERE code = 'remaining_permissions'
});
},
};