Tomas Cohen Arazi
562eaa154b
With the introduction of the /public namespace all other endpoints, the rest of the endpoints are restricted to privileged users. This patch makes the GET /libraries and GET /libraries/:library_id endpoints require 'catalogue' permissions. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
403 lines
10 KiB
JSON
403 lines
10 KiB
JSON
{
|
|
"/libraries": {
|
|
"get": {
|
|
"x-mojo-to": "Library#list",
|
|
"operationId": "listLibrary",
|
|
"tags": [
|
|
"library"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "name",
|
|
"in": "query",
|
|
"description": "Case insensitive 'starts-with' search on name",
|
|
"required": false,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "address1",
|
|
"in": "query",
|
|
"description": "Case insensitive 'starts-with' search on address1",
|
|
"required": false,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "address2",
|
|
"in": "query",
|
|
"description": "Case insensitive 'starts-with' search on address2",
|
|
"required": false,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "address3",
|
|
"in": "query",
|
|
"description": "Case insensitive 'starts-with' search on address3",
|
|
"required": false,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "postal_code",
|
|
"in": "query",
|
|
"description": "Case insensitive 'starts-with' search on postal code",
|
|
"required": false,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "city",
|
|
"in": "query",
|
|
"description": "Case insensitive 'starts-with' search on city",
|
|
"required": false,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "state",
|
|
"in": "query",
|
|
"description": "Case insensitive 'starts-with' search on state",
|
|
"required": false,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "country",
|
|
"in": "query",
|
|
"description": "Case insensitive 'starts_with' search on country",
|
|
"required": false,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "phone",
|
|
"in": "query",
|
|
"description": "Case insensitive 'starts_with' search on phone number",
|
|
"required": false,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "fax",
|
|
"in": "query",
|
|
"description": "Case insensitive 'starts_with' search on fax number",
|
|
"required": false,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "email",
|
|
"in": "query",
|
|
"description": "Case insensitive 'starts_with' search on email address",
|
|
"required": false,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "reply_to_email",
|
|
"in": "query",
|
|
"description": "Case insensitive 'starts_with' search on Reply-To email address",
|
|
"required": false,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "return_path_email",
|
|
"in": "query",
|
|
"description": "Case insensitive 'starts_with' search on Return-Path email address",
|
|
"required": false,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "url",
|
|
"in": "query",
|
|
"description": "Case insensitive 'starts_with' search on website URL",
|
|
"required": false,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "ip",
|
|
"in": "query",
|
|
"description": "Case insensitive 'starts_with' search on IP address",
|
|
"required": false,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "notes",
|
|
"in": "query",
|
|
"description": "Case insensitive 'starts_with' search on notes",
|
|
"required": false,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "opac_info",
|
|
"in": "query",
|
|
"description": "Case insensitive 'starts-with' search on OPAC info",
|
|
"required": false,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "A list of libraries",
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "../definitions.json#/library"
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal error",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/error"
|
|
}
|
|
},
|
|
"503": {
|
|
"description": "Under maintenance",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/error"
|
|
}
|
|
}
|
|
},
|
|
"x-koha-authorization": {
|
|
"permissions": {
|
|
"catalogue": "1"
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"x-mojo-to": "Library#add",
|
|
"operationId": "addLibrary",
|
|
"tags": [
|
|
"library"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"description": "A JSON object containing informations about the new library",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "../definitions.json#/library"
|
|
}
|
|
}
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"responses": {
|
|
"201": {
|
|
"description": "Library added",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/library"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/error"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Authentication required",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/error"
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Access forbidden",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/error"
|
|
}
|
|
},
|
|
"409": {
|
|
"description": "Conflict in creating resource",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/error"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal error",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/error"
|
|
}
|
|
},
|
|
"503": {
|
|
"description": "Under maintenance",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/error"
|
|
}
|
|
}
|
|
},
|
|
"x-koha-authorization": {
|
|
"permissions": {
|
|
"parameters": "manage_libraries"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/libraries/{library_id}": {
|
|
"get": {
|
|
"x-mojo-to": "Library#get",
|
|
"operationId": "getLibrary",
|
|
"tags": [
|
|
"library"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"$ref": "../parameters.json#/library_id_pp"
|
|
}
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "A library",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/library"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Library not found",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/error"
|
|
}
|
|
}
|
|
},
|
|
"x-koha-authorization": {
|
|
"permissions": {
|
|
"catalogue": "1"
|
|
}
|
|
}
|
|
},
|
|
"put": {
|
|
"x-mojo-to": "Library#update",
|
|
"operationId": "updateLibrary",
|
|
"tags": [
|
|
"library"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"$ref": "../parameters.json#/library_id_pp"
|
|
},
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"description": "A JSON object containing information on the library",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "../definitions.json#/library"
|
|
}
|
|
}
|
|
],
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "A library",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/library"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad request",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/error"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Authentication required",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/error"
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Access forbidden",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/error"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Library not found",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/error"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal error",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/error"
|
|
}
|
|
},
|
|
"503": {
|
|
"description": "Under maintenance",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/error"
|
|
}
|
|
}
|
|
},
|
|
"x-koha-authorization": {
|
|
"permissions": {
|
|
"parameters": "manage_libraries"
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"x-mojo-to": "Library#delete",
|
|
"operationId": "deleteLibrary",
|
|
"tags": [
|
|
"library"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"$ref": "../parameters.json#/library_id_pp"
|
|
}
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"responses": {
|
|
"204": {
|
|
"description": "Library deleted",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Authentication required",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/error"
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Access forbidden",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/error"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Library not found",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/error"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal error",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/error"
|
|
}
|
|
},
|
|
"503": {
|
|
"description": "Under maintenance",
|
|
"schema": {
|
|
"$ref": "../definitions.json#/error"
|
|
}
|
|
}
|
|
},
|
|
"x-koha-authorization": {
|
|
"permissions": {
|
|
"parameters": "manage_libraries"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|