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

(-)a/api/v1/swagger/paths/checkouts.yaml (-1 / +2 lines)
Lines 59-65 Link Here
59
          $ref: "../swagger.yaml#/definitions/error"
59
          $ref: "../swagger.yaml#/definitions/error"
60
    x-koha-authorization:
60
    x-koha-authorization:
61
      permissions:
61
      permissions:
62
        circulate: circulate_remaining_permissions
62
        - circulate: circulate_remaining_permissions
63
        - circulate: manage_bookings
63
  post:
64
  post:
64
    x-mojo-to: Checkouts#add
65
    x-mojo-to: Checkouts#add
65
    operationId: addCheckout
66
    operationId: addCheckout
(-)a/t/db_dependent/api/v1/checkouts.t (-2 / +23 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 105;
20
use Test::More tests => 108;
21
use Test::MockModule;
21
use Test::MockModule;
22
use Test::Mojo;
22
use Test::Mojo;
23
use t::lib::Mocks;
23
use t::lib::Mocks;
Lines 70-75 $t->get_ok( "//$userid:$password@/api/v1/checkouts?patron_id=$notexisting_patron Link Here
70
  ->status_is(200)
70
  ->status_is(200)
71
  ->json_is([]);
71
  ->json_is([]);
72
72
73
my $bookings_librarian = $builder->build_object(
74
    {
75
        class => 'Koha::Patrons',
76
        value => { flags => 0 }     # no additional permissions
77
    }
78
);
79
$builder->build(
80
    {
81
        source => 'UserPermission',
82
        value  => {
83
            borrowernumber => $bookings_librarian->borrowernumber,
84
            module_bit     => 1,
85
            code           => 'manage_bookings',
86
        },
87
    }
88
);
89
$bookings_librarian->set_password( { password => $password, skip_validation => 1 } );
90
my $bookings_userid = $bookings_librarian->userid;
91
92
$t->get_ok("//$bookings_userid:$password@/api/v1/checkouts?patron_id=$patron_id")
93
    ->status_is( 200, 'manage_bookings allows checkouts access' )->json_is( [] );
94
73
Koha::CirculationRules->set_rules(
95
Koha::CirculationRules->set_rules(
74
    {
96
    {
75
        categorycode => undef,
97
        categorycode => undef,
76
- 

Return to bug 35469