Bug 23584: Add the controller method and tests
commite04654052eadac2868fcf7e911705d22f6af1b9c
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 16 Sep 2019 18:06:09 +0000 (16 15:06 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 23 Sep 2019 09:52:50 +0000 (23 10:52 +0100)
tree76ac4dc825186a1d3918f9642244c08662fd4122
parentc415476a37463540e702a5070a192ce413e834f1
Bug 23584: Add the controller method and tests

This patchset adds endpoints for the patrons to change their privacy
settings regarding their guarantors.

The following endpoints are added:

  PUT /public/patrons/:patron_id/guarantors/can_see_charges
  PUT /public/patrons/:patron_id/guarantors/can_see_checkouts

They can only be used by the patron themselves with valid sessions. And
enforce the AllowPatronToSetCheckoutsVisibilityForGuarantor and
AllowPatronToSetFinesVisibilityForGuarantor system preferences when
required.

All this is covered by unit tests.

To test:
1) Run:
  $ kshell
 k$ prove t/db_dependent/api/v1/patrons.t
=> SUCCESS: Tests pass!
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Koha/REST/V1/Patrons.pm
t/db_dependent/api/v1/patrons.t