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

(-)a/api/v1/swagger/paths/libraries.json (+10 lines)
Lines 152-157 Link Here
152
            "$ref": "../definitions.json#/error"
152
            "$ref": "../definitions.json#/error"
153
          }
153
          }
154
        }
154
        }
155
      },
156
      "x-koha-authorization": {
157
        "permissions": {
158
          "catalogue": "1"
159
        }
155
      }
160
      }
156
    },
161
    },
157
    "post": {
162
    "post": {
Lines 253-258 Link Here
253
            "$ref": "../definitions.json#/error"
258
            "$ref": "../definitions.json#/error"
254
          }
259
          }
255
        }
260
        }
261
      },
262
      "x-koha-authorization": {
263
        "permissions": {
264
          "catalogue": "1"
265
        }
256
      }
266
      }
257
    },
267
    },
258
    "put": {
268
    "put": {
(-)a/t/db_dependent/api/v1/libraries.t (-3 / +2 lines)
Lines 48-54 subtest 'list() tests' => sub { Link Here
48
    my $another_library = $library->unblessed; # create a copy of $library but make
48
    my $another_library = $library->unblessed; # create a copy of $library but make
49
    delete $another_library->{branchcode};     # sure branchcode will be regenerated
49
    delete $another_library->{branchcode};     # sure branchcode will be regenerated
50
    $another_library = $builder->build_object({ class => 'Koha::Libraries', value => $another_library });
50
    $another_library = $builder->build_object({ class => 'Koha::Libraries', value => $another_library });
51
    my ( $borrowernumber, $session_id ) = create_user_and_session( { authorized => 0 } );
51
    my ( $borrowernumber, $session_id ) = create_user_and_session( { authorized => 1 } );
52
52
53
    ## Authorized user tests
53
    ## Authorized user tests
54
    my $count_of_libraries = Koha::Libraries->search->count;
54
    my $count_of_libraries = Koha::Libraries->search->count;
Lines 119-125 subtest 'get() tests' => sub { Link Here
119
119
120
    my $library = $builder->build_object( { class => 'Koha::Libraries' } );
120
    my $library = $builder->build_object( { class => 'Koha::Libraries' } );
121
    my ( $borrowernumber, $session_id ) =
121
    my ( $borrowernumber, $session_id ) =
122
      create_user_and_session( { authorized => 0 } );
122
      create_user_and_session( { authorized => 1 } );
123
123
124
    my $tx = $t->ua->build_tx( GET => "/api/v1/libraries/" . $library->branchcode );
124
    my $tx = $t->ua->build_tx( GET => "/api/v1/libraries/" . $library->branchcode );
125
    $tx->req->cookies( { name => 'CGISESSID', value => $session_id } );
125
    $tx->req->cookies( { name => 'CGISESSID', value => $session_id } );
126
- 

Return to bug 16497