]> git.koha-community.org Git - koha.git/commit
Bug 31791: Add x-record-source-id header to POST /biblios
authorTomas Cohen Arazi <tomascohen@theke.io>
Thu, 8 Feb 2024 23:18:35 +0000 (20:18 -0300)
committerKatrin Fischer <katrin.fischer@bsz-bw.de>
Fri, 26 Apr 2024 18:15:38 +0000 (20:15 +0200)
commita054c569dd0579187f28efa66d763cb4cd06d8d3
tree539d3708897c3ea02157f56852e5d3f5b4f56026
parentcb8f95bce0408927abce0ee0abbbe2c66dfc7fa8
Bug 31791: Add x-record-source-id header to POST /biblios

This patch adds support for setting the record source on the API. It
does so by adding support for a new header `x-record-source-id`.

Setting the record source is restricted to patrons with the
`set_record_sources` permission.

A 403 error is returned on an attempt to set it without the correct
permissions.

The feature is documented on the spec.

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/biblios.t
=> SUCCESS: Tests pass! Tests cover the right use cases!
3. Play with Postman (or similar)
4. Sign off :-D

Sponsored-by: ByWater Solutions
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Koha/REST/V1/Biblios.pm
api/v1/swagger/paths/biblios.yaml
api/v1/swagger/swagger.yaml
t/db_dependent/api/v1/biblios.t