Bug 29523: Pass the logged user around and use for validating
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 26 Nov 2021 15:35:05 +0000 (15:35 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 27 Oct 2023 19:40:44 +0000 (16:40 -0300)
commit1477ffc7529277f49791966451dcb9a1c798b017
tree144d68b3759703b36b8bb84af3d8b4dfc030d9b2
parenta05f83d8fd62ca3702204f193ce83d0875e369f6
Bug 29523: Pass the logged user around and use for validating

In this patch I add 'user', containing the Koha::Patron object for the
logged in user in the params hash we pass around in to_api. I then use
that in a new 'is_accessible' method added to Koha::Patron.

The new method is really the equivilent of 'search_limited' in the plural
class and could perhaps be renamed 'is_limited' or something clearer for
the singular form 'is_filtered' or 'fitler_for_api' or something?

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Koha/Object.pm
Koha/Patron.pm
Koha/REST/Plugin/Objects.pm
t/db_dependent/Koha/Object.t