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

(-)a/api/v1/swagger/paths/authorities.yaml (-6 / +2 lines)
Lines 74-84 Link Here
74
        schema:
74
        schema:
75
          $ref: "../swagger.yaml#/definitions/error"
75
          $ref: "../swagger.yaml#/definitions/error"
76
      "404":
76
      "404":
77
        description: Biblio not found
77
        description: Authority not found
78
        schema:
79
          $ref: "../swagger.yaml#/definitions/error"
80
      "409":
81
        description: Unable to perform action on biblio
82
        schema:
78
        schema:
83
          $ref: "../swagger.yaml#/definitions/error"
79
          $ref: "../swagger.yaml#/definitions/error"
84
      "500":
80
      "500":
Lines 91-94 Link Here
91
          $ref: "../swagger.yaml#/definitions/error"
87
          $ref: "../swagger.yaml#/definitions/error"
92
    x-koha-authorization:
88
    x-koha-authorization:
93
      permissions:
89
      permissions:
94
        editcatalogue: edit_catalogue
90
        editauthorities: "1"
(-)a/t/db_dependent/api/v1/authorities.t (-13 / +2 lines)
Lines 141-157 subtest 'delete() tests' => sub { Link Here
141
    $t->delete_ok("//$userid:$password@/api/v1/authorities/".$authority->authid)
141
    $t->delete_ok("//$userid:$password@/api/v1/authorities/".$authority->authid)
142
      ->status_is(403, 'Not enough permissions makes it return the right code');
142
      ->status_is(403, 'Not enough permissions makes it return the right code');
143
143
144
    # Add permissions
144
    $patron->flags( 2 ** 14 )->store; # 14 => editauthorities userflag
145
    $builder->build(
146
        {
147
            source => 'UserPermission',
148
            value  => {
149
                borrowernumber => $patron->borrowernumber,
150
                module_bit     => 9,
151
                code           => 'edit_catalogue'
152
            }
153
        }
154
    );
155
145
156
    $t->delete_ok("//$userid:$password@/api/v1/authorities/".$authority->authid)
146
    $t->delete_ok("//$userid:$password@/api/v1/authorities/".$authority->authid)
157
      ->status_is(204, 'SWAGGER3.2.4')
147
      ->status_is(204, 'SWAGGER3.2.4')
Lines 161-164 subtest 'delete() tests' => sub { Link Here
161
      ->status_is(404);
151
      ->status_is(404);
162
152
163
    $schema->storage->txn_rollback;
153
    $schema->storage->txn_rollback;
164
};
154
};
165
- 

Return to bug 31793