View | Details | Raw Unified | Return to bug 14298
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_14298_add_permissions_circulate_self_checkout.perl (+27 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
use C4::Context;
4
my $dbh = C4::Context->dbh;
5
6
$dbh->do(q|
7
    INSERT INTO permissions (module_bit, code, description)
8
    VALUES (1, 'self_checkout', 'Perform self checkout at the OPAC. It should be used for the patron matching the AutoSelfCheckID')
9
|);
10
11
my $AutoSelfCheckID = C4::Context->preference('AutoSelfCheckID');
12
13
$dbh->do(q|
14
    UPDATE borrowers
15
    SET flags=0
16
    WHERE userid=?
17
|, undef, $AutoSelfCheckID);
18
19
$dbh->do(q|
20
    DELETE FROM user_permissions
21
    WHERE borrowernumber=(SELECT borrowernumber FROM borrowers WHERE userid=?)
22
|, undef, $AutoSelfCheckID);
23
24
$dbh->do(q|
25
    INSERT INTO user_permissions(borrowernumber, module_bit, code)
26
    SELECT borrowernumber, 1, 'self_checkout' FROM borrowers WHERE userid=?
27
|, undef, $AutoSelfCheckID);
(-)a/installer/data/mysql/en/mandatory/userpermissions.sql (-1 / +1 lines)
Lines 4-9 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
4
   ( 1, 'overdues_report', 'Execute overdue items report'),
4
   ( 1, 'overdues_report', 'Execute overdue items report'),
5
   ( 1, 'force_checkout', 'Force checkout if a limitation exists'),
5
   ( 1, 'force_checkout', 'Force checkout if a limitation exists'),
6
   ( 1, 'manage_restrictions', 'Manage restrictions for accounts'),
6
   ( 1, 'manage_restrictions', 'Manage restrictions for accounts'),
7
   ( 1, 'self_checkout', 'Perform self checkout at the OPAC. It should be used for the patron matching the AutoSelfCheckID'),
7
   ( 3, 'parameters_remaining_permissions', 'Remaining system parameters permissions'),
8
   ( 3, 'parameters_remaining_permissions', 'Remaining system parameters permissions'),
8
   ( 3, 'manage_circ_rules', 'manage circulation rules'),
9
   ( 3, 'manage_circ_rules', 'manage circulation rules'),
9
   ( 6, 'place_holds', 'Place holds for patrons'),
10
   ( 6, 'place_holds', 'Place holds for patrons'),
10
- 

Return to bug 14298