|
Lines 7-24
return {
Link Here
|
| 7 |
my ($args) = @_; |
7 |
my ($args) = @_; |
| 8 |
my ($dbh, $out) = @$args{qw(dbh out)}; |
8 |
my ($dbh, $out) = @$args{qw(dbh out)}; |
| 9 |
|
9 |
|
| 10 |
$dbh->do(q{ |
10 |
my $permission_added = $dbh->do(q{ |
| 11 |
INSERT IGNORE INTO permissions (module_bit, code, description) VALUES ( 9, 'edit_any_item', 'Edit any item reguardless of home library'); |
11 |
INSERT IGNORE INTO permissions (module_bit, code, description) VALUES ( 9, 'edit_any_item', 'Edit any item reguardless of home library'); |
| 12 |
}); |
12 |
}); |
| 13 |
say $out "Added new permission 'edit_any_item'"; |
|
|
| 14 |
|
13 |
|
| 15 |
$dbh->do(q{ |
14 |
if( $permission_added == 1 ){ |
| 16 |
INSERT IGNORE INTO user_permissions ( borrowernumber, module_bit, code ) |
15 |
say $out "Added new permission 'edit_any_item'"; |
| 17 |
SELECT borrowernumber, '9', 'edit_any_item' |
16 |
|
| 18 |
FROM user_permissions |
17 |
$dbh->do(q{ |
| 19 |
WHERE module_bit = '9' |
18 |
INSERT IGNORE INTO user_permissions ( borrowernumber, module_bit, code ) |
| 20 |
AND code = 'edit_items' |
19 |
SELECT borrowernumber, '9', 'edit_any_item' |
| 21 |
}); |
20 |
FROM user_permissions |
|
|
21 |
WHERE module_bit = '9' |
| 22 |
AND code = 'edit_items' |
| 23 |
}); |
| 24 |
say $out "Added 'edit_any_item' permission to users with edit items permission"; |
| 25 |
} |
| 22 |
|
26 |
|
| 23 |
if ( !column_exists( 'library_groups', 'ft_limit_item_editing' ) ) { |
27 |
if ( !column_exists( 'library_groups', 'ft_limit_item_editing' ) ) { |
| 24 |
$dbh->do(q{ |
28 |
$dbh->do(q{ |
| 25 |
- |
|
|