Tomas Cohen Arazi
b70ce9dcad
This patch makes the route require the right permissions. Tests are adjusted to reflect this new situation. To test: 1. Apply this patch 2. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/authorities.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
90 lines
2.4 KiB
YAML
90 lines
2.4 KiB
YAML
---
|
|
"/authorities/{authority_id}":
|
|
get:
|
|
x-mojo-to: Authorities#get
|
|
operationId: getAuthority
|
|
tags:
|
|
- authorities
|
|
summary: Get authority
|
|
parameters:
|
|
- $ref: "../swagger.yaml#/parameters/authority_id_pp"
|
|
produces:
|
|
- application/json
|
|
- application/marcxml+xml
|
|
- application/marc-in-json
|
|
- application/marc
|
|
- text/plain
|
|
responses:
|
|
"200":
|
|
description: An authority
|
|
"401":
|
|
description: Authentication required
|
|
schema:
|
|
$ref: "../swagger.yaml#/definitions/error"
|
|
"403":
|
|
description: Access forbidden
|
|
schema:
|
|
$ref: "../swagger.yaml#/definitions/error"
|
|
"404":
|
|
description: Authority not found
|
|
schema:
|
|
$ref: "../swagger.yaml#/definitions/error"
|
|
"406":
|
|
description: Not acceptable
|
|
schema:
|
|
type: array
|
|
description: Accepted content-types
|
|
items:
|
|
type: string
|
|
"500":
|
|
description: |
|
|
Internal server error. Possible `error_code` attribute values:
|
|
|
|
* `internal_server_error`
|
|
schema:
|
|
$ref: "../swagger.yaml#/definitions/error"
|
|
"503":
|
|
description: Under maintenance
|
|
schema:
|
|
$ref: "../swagger.yaml#/definitions/error"
|
|
x-koha-authorization:
|
|
permissions:
|
|
catalogue: "1"
|
|
delete:
|
|
x-mojo-to: Authorities#delete
|
|
operationId: deleteAuthority
|
|
tags:
|
|
- authorities
|
|
summary: Delete authority
|
|
parameters:
|
|
- $ref: "../swagger.yaml#/parameters/authority_id_pp"
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"204":
|
|
description: Authority deleted
|
|
schema:
|
|
type: string
|
|
"401":
|
|
description: Authentication required
|
|
schema:
|
|
$ref: "../swagger.yaml#/definitions/error"
|
|
"403":
|
|
description: Access forbidden
|
|
schema:
|
|
$ref: "../swagger.yaml#/definitions/error"
|
|
"404":
|
|
description: Authority not found
|
|
schema:
|
|
$ref: "../swagger.yaml#/definitions/error"
|
|
"500":
|
|
description: Internal error
|
|
schema:
|
|
$ref: "../swagger.yaml#/definitions/error"
|
|
"503":
|
|
description: Under maintenance
|
|
schema:
|
|
$ref: "../swagger.yaml#/definitions/error"
|
|
x-koha-authorization:
|
|
permissions:
|
|
editauthorities: "1"
|