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

(-)a/api/v1/swagger/paths/cities.json (+10 lines)
Lines 60-65 Link Here
60
            "$ref": "../definitions.json#/error"
60
            "$ref": "../definitions.json#/error"
61
          }
61
          }
62
        }
62
        }
63
      },
64
      "x-koha-authorization": {
65
        "permissions": {
66
            "catalogue": "1"
67
        }
63
      }
68
      }
64
    },
69
    },
65
    "post": {
70
    "post": {
Lines 153-158 Link Here
153
            "$ref": "../definitions.json#/error"
158
            "$ref": "../definitions.json#/error"
154
          }
159
          }
155
        }
160
        }
161
      },
162
      "x-koha-authorization": {
163
        "permissions": {
164
            "catalogue": "1"
165
        }
156
      }
166
      }
157
    },
167
    },
158
    "put": {
168
    "put": {
(-)a/t/db_dependent/api/v1/cities.t (-4 / +2 lines)
Lines 45-52 subtest 'list() tests' => sub { Link Here
45
    $schema->storage->txn_begin;
45
    $schema->storage->txn_begin;
46
46
47
    Koha::Cities->search->delete;
47
    Koha::Cities->search->delete;
48
    my ( $borrowernumber, $session_id ) =
48
    my ( $borrowernumber, $session_id ) = create_user_and_session({ authorized => 1 });
49
      create_user_and_session( { authorized => 0 } );
50
49
51
    ## Authorized user tests
50
    ## Authorized user tests
52
    # No cities, so empty array should be returned
51
    # No cities, so empty array should be returned
Lines 116-122 subtest 'get() tests' => sub { Link Here
116
    $schema->storage->txn_begin;
115
    $schema->storage->txn_begin;
117
116
118
    my $city = $builder->build_object({ class => 'Koha::Cities' });
117
    my $city = $builder->build_object({ class => 'Koha::Cities' });
119
    my ( $borrowernumber, $session_id ) = create_user_and_session({ authorized => 0 });
118
    my ( $borrowernumber, $session_id ) = create_user_and_session({ authorized => 1 });
120
119
121
    my $tx = $t->ua->build_tx( GET => "/api/v1/cities/" . $city->id );
120
    my $tx = $t->ua->build_tx( GET => "/api/v1/cities/" . $city->id );
122
    $tx->req->cookies({ name => 'CGISESSID', value => $session_id });
121
    $tx->req->cookies({ name => 'CGISESSID', value => $session_id });
123
- 

Return to bug 22227