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

(-)a/installer/data/mysql/atomicupdate/bug_38924-patron_quotas.pl (-2 / +9 lines)
Lines 3-9 use Koha::Installer::Output qw(say_warning say_success say_info); Link Here
3
3
4
return {
4
return {
5
    bug_number  => "38924",
5
    bug_number  => "38924",
6
    description => "Add patron quota table",
6
    description => "Add patron quota table and permissions",
7
    up          => sub {
7
    up          => sub {
8
        my ($args) = @_;
8
        my ($args) = @_;
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
Lines 25-31 return { Link Here
25
                ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
25
                ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
26
                }
26
                }
27
            );
27
            );
28
            say_success( $out, "Patron quota table created successfully" );
28
            
29
            $dbh->do(q{
30
                INSERT IGNORE INTO permissions (module_bit, code, description) VALUES
31
                (4, 'manage_borrower_quotas', 'Manage patron quotas'),
32
                (4, 'view_borrower_quotas', 'View patron quotas')
33
            });
34
            
35
            say_success( $out, "Patron quota table and permissions created successfully" );
29
        } else {
36
        } else {
30
            say_info( $out, "Patron quota table already exists" );
37
            say_info( $out, "Patron quota table already exists" );
31
        }
38
        }
(-)a/installer/data/mysql/mandatory/userpermissions.sql (+2 lines)
Lines 50-57 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
50
   ( 4, 'edit_borrowers', 'Add, modify and view patron information'),
50
   ( 4, 'edit_borrowers', 'Add, modify and view patron information'),
51
   ( 4, 'list_borrowers', 'Search, list and view patrons'),
51
   ( 4, 'list_borrowers', 'Search, list and view patrons'),
52
   ( 4, 'merge_borrowers', 'Merge patrons'),
52
   ( 4, 'merge_borrowers', 'Merge patrons'),
53
   ( 4, 'manage_borrower_quotas', 'Manage patron quotas'),
53
   ( 4, 'send_messages_to_borrowers', 'Send messages to patrons'),
54
   ( 4, 'send_messages_to_borrowers', 'Send messages to patrons'),
54
   ( 4, 'view_borrower_infos_from_any_libraries', 'View patron infos from any libraries'),
55
   ( 4, 'view_borrower_infos_from_any_libraries', 'View patron infos from any libraries'),
56
   ( 4, 'view_borrower_quotas', 'View patron quotas'),
55
   ( 4, 'view_checkout_history', 'View checkout history'),
57
   ( 4, 'view_checkout_history', 'View checkout history'),
56
   ( 4, 'view_holds_history', 'View holds history'),
58
   ( 4, 'view_holds_history', 'View holds history'),
57
   ( 6, 'place_holds', 'Place holds for patrons'),
59
   ( 6, 'place_holds', 'Place holds for patrons'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc (+6 lines)
Lines 574-579 Link Here
574
    [%- CASE 'marc_order_manage' -%]
574
    [%- CASE 'marc_order_manage' -%]
575
        <span class="sub_permission marc_order_manage_subpermission"> Manage MARC ordering </span>
575
        <span class="sub_permission marc_order_manage_subpermission"> Manage MARC ordering </span>
576
        <span class="permissioncode">([% name | html %])</span>
576
        <span class="permissioncode">([% name | html %])</span>
577
    [%- CASE 'view_borrower_quotas' -%]
578
        <span class="sub_permission view_borrower_quotas_subpermission"> View patron quotas </span>
579
        <span class="permissioncode">([% name | html %])</span>
580
    [%- CASE 'manage_borrower_quotas' -%]
581
        <span class="sub_permission manage_borrower_quotas_subpermission"> Manage patron quotas </span>
582
        <span class="permissioncode">([% name | html %])</span>
577
    [%- CASE 'reopen_closed_invoices' -%]
583
    [%- CASE 'reopen_closed_invoices' -%]
578
        <span class="sub_permission reopen_closed_invoices_subpermission"> Reopen closed invoices </span>
584
        <span class="sub_permission reopen_closed_invoices_subpermission"> Reopen closed invoices </span>
579
        <span class="permissioncode">([% name | html %])</span>
585
        <span class="permissioncode">([% name | html %])</span>
(-)a/t/Koha/Auth/Permissions.t (-1 / +2 lines)
Lines 131-136 subtest 'superlibrarian tests' => sub { Link Here
131
        'CAN_user_borrowers_edit_borrowers'                         => 1,
131
        'CAN_user_borrowers_edit_borrowers'                         => 1,
132
        'CAN_user_borrowers_list_borrowers'                         => 1,
132
        'CAN_user_borrowers_list_borrowers'                         => 1,
133
        'CAN_user_borrowers_api_validate_password'                  => 1,
133
        'CAN_user_borrowers_api_validate_password'                  => 1,
134
        'CAN_user_borrowers_manage_borrower_quotas'                 => 1,
135
        'CAN_user_borrowers_view_borrower_quotas'                   => 1,
134
        'CAN_user_borrowers_view_borrower_infos_from_any_libraries' => 1,
136
        'CAN_user_borrowers_view_borrower_infos_from_any_libraries' => 1,
135
        'CAN_user_borrowers_view_checkout_history'                  => 1,
137
        'CAN_user_borrowers_view_checkout_history'                  => 1,
136
        'CAN_user_borrowers_view_holds_history'                     => 1,
138
        'CAN_user_borrowers_view_holds_history'                     => 1,
137
- 

Return to bug 38924