LP
1499123: Modify Perl code for csp.ignore_proximity field.
* Add get_org_unit_proximity function to AppUtils.
First, we add a helper function to OpenILS::Application::AppUtils that
returns the proximity value between a "from" org_unit and a "to"
org_unit. It takes a CStoreEditor and the ids of the two org_units as
arguments.
* Use csp.ignore_proximity in O::A::Circ::Circulate::Circulator.
Modify the check_hold_fulfill_blocks method of the Circulator object
to take the csp.ignore_proximity into account.
The new code first calculates the proximity of the circ_lib and the
copy's circ_lib with the patron's home_ou. It then modifies the main
query in the function to check if the csp object's ignore_proximity
is null or greater than either of the two calculated proximity values.
* Teach SIP::Patron about csp.ignore_proximity.
We modify SIP::Patron::flesh_user_penalties to not report penalties
within csp.ignore_proximity of the user's home_ou.
In order to have a notion of "here" for the proximity check, we modify
SIP::Patron->new to assign its authtoken argument, if any, to the
CStoreEditor. We then use this authtoken to retrieve the authsession
user so that we may use the authsession user's ws_ou or home_ou as a
context ou for penalty lookup and filtering based on the
csp.ignore_proximity in flesh_user_penalties. If we're not given the
authtoken, we fall back to using the patron's home_ou and the
penalty's context ou for the proximity lookup.
This assumes, of course, that the authsession user's ws_ou or home_ou
have a logical relationship with the desired transaction ou. For most
self-checks this will likely be true. For other uses of the SIP
protocol, this is less likely to be true.
* Add Perl live tests.
Add tests for basic checkout and hold functionality as well as for
the OpenILS::SIP::Patron->flesh_user_penalties() changes.
Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>