Line 0
Link Here
|
0 |
- |
1 |
use Modern::Perl; |
|
|
2 |
|
3 |
return { |
4 |
bug_number => "29509", |
5 |
description => "Update users with list_borrowers permission where required", |
6 |
up => sub { |
7 |
my ($args) = @_; |
8 |
my ( $dbh, $out ) = @$args{qw(dbh out)}; |
9 |
|
10 |
$dbh->do( |
11 |
"INSERT IGNORE INTO permissions (module_bit, code, description) VALUES (4, 'list_borrowers', 'Search, list and view patrons')" |
12 |
); |
13 |
|
14 |
# Check for 'borrowers' or 'borrowers > edit_borrowers' permission |
15 |
say $out "list_borrowers added to all users with edit_borrowers"; |
16 |
# Check for 'circulate' or 'circulate > manage_bookings' permission |
17 |
say $out "list_borrowers added to all users with manage_bookings"; |
18 |
# Check for 'tools' or 'tools > label_creator' permission |
19 |
say $out "list_borrowers added to all users with label_creator"; |
20 |
# Check for 'serials' or 'serials > routing' permission |
21 |
say $out "list_borrowers added to all users with routing"; |
22 |
# Check for 'acquisitions' or 'acquisitions > order_manage' permission |
23 |
say $out "list_borrowers added to all users with order_manage"; |
24 |
|
25 |
# Checks above should also confirm users don't already have top level 'borrowers' permission before adding the sub-permission |
26 |
}, |
27 |
}; |