Koha/installer/data/mysql/db_revs/220600038.pl
Tomas Cohen Arazi 6e127ad894
Bug 30335: Fix DBRev permissions
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-08-31 10:18:23 -03:00

25 lines
961 B
Perl
Executable file

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')
});
$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'
});
},
};