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

(-)a/api/v1/swagger/paths/authorities.yaml (-1 / +1 lines)
Lines 73-79 Link Here
73
          $ref: "../swagger.yaml#/definitions/error"
73
          $ref: "../swagger.yaml#/definitions/error"
74
    x-koha-authorization:
74
    x-koha-authorization:
75
      permissions:
75
      permissions:
76
        editcatalogue: edit_catalogue
76
        editauthorities: "1"
77
"/authorities/{authority_id}":
77
"/authorities/{authority_id}":
78
  get:
78
  get:
79
    x-mojo-to: Authorities#get
79
    x-mojo-to: Authorities#get
(-)a/t/db_dependent/api/v1/authorities.t (-11 / +1 lines)
Lines 189-204 subtest 'post() tests' => sub { Link Here
189
      ->status_is(403, 'Not enough permissions makes it return the right code');
189
      ->status_is(403, 'Not enough permissions makes it return the right code');
190
190
191
    # Add permissions
191
    # Add permissions
192
    $builder->build(
192
    $patron->flags( 2 ** 14 )->store; # 14 => editauthorities userflag
193
        {
194
            source => 'UserPermission',
195
            value  => {
196
                borrowernumber => $patron->borrowernumber,
197
                module_bit     => 9,
198
                code           => 'edit_catalogue'
199
            }
200
        }
201
    );
202
193
203
    # x-koha-override passed to make sure it goes through
194
    # x-koha-override passed to make sure it goes through
204
    $t->post_ok("//$userid:$password@/api/v1/authorities" => {'Content-Type' => 'application/marcxml+xml', 'x-authority-type' => 'CORPO_NAME', 'x-koha-override' => 'any' } => $marcxml)
195
    $t->post_ok("//$userid:$password@/api/v1/authorities" => {'Content-Type' => 'application/marcxml+xml', 'x-authority-type' => 'CORPO_NAME', 'x-koha-override' => 'any' } => $marcxml)
205
- 

Return to bug 31795