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

(-)a/installer/data/mysql/atomicupdate/bug_32682_add_permission.pl (+35 lines)
Line 0 Link Here
1
use Modern::Perl;
2
use Koha::Installer::Output qw(say_warning say_success say_info);
3
4
return {
5
    bug_number  => "32682",
6
    description => "Add permission for viewing patron reading history",
7
    up          => sub {
8
        my ($args) = @_;
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
10
11
        $dbh->do(
12
            q{
13
            INSERT IGNORE permissions (module_bit, code, description) VALUES
14
            (4, 'view_checkout_history', 'Viewing checkout history')
15
        }
16
        );
17
18
        # permissions
19
        say $out "Added new permission 'view_checkout_history'";
20
21
        # $dbh->do(
22
        #     q{
23
        #     INSERT IGNORE INTO user_permissions (borrowernumber, module_bit, code)
24
        #     SELECT borrowernumber, 10, 'view_checkout_history' FROM user_permissions WHERE code = 'remaining_permissions'
25
        # }
26
        # );
27
28
        # TODO: migrate libraries' "intranetreadinghistory" syspref (will this require us to not fully remove it until we're sure everyone has migrated off of it?)
29
30
        # Other information
31
        say_success( $out, "Use green for success" );
32
        say_warning( $out, "Use yellow for warning/a call to action" );
33
        say_info( $out, "Use blue for further information" );
34
    },
35
};
(-)a/installer/data/mysql/mandatory/userpermissions.sql (-1 / +1 lines)
Lines 49-54 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
49
   ( 4, 'list_borrowers', 'Search, list and view patrons'),
49
   ( 4, 'list_borrowers', 'Search, list and view patrons'),
50
   ( 4, 'send_messages_to_borrowers', 'Send messages to patrons'),
50
   ( 4, 'send_messages_to_borrowers', 'Send messages to patrons'),
51
   ( 4, 'view_borrower_infos_from_any_libraries', 'View patron infos from any libraries'),
51
   ( 4, 'view_borrower_infos_from_any_libraries', 'View patron infos from any libraries'),
52
   ( 4, 'view_checkout_history', 'Viewing checkout history'),
52
   ( 6, 'place_holds', 'Place holds for patrons'),
53
   ( 6, 'place_holds', 'Place holds for patrons'),
53
   ( 6, 'modify_holds_priority', 'Modify holds priority'),
54
   ( 6, 'modify_holds_priority', 'Modify holds priority'),
54
   ( 9, 'edit_catalogue', 'Edit catalog (Modify bibliographic/holdings data)'),
55
   ( 9, 'edit_catalogue', 'Edit catalog (Modify bibliographic/holdings data)'),
55
- 

Return to bug 32682