[open-ils-commits] [GIT] Evergreen ILS branch master updated. 42939f1edc805adb63d4e2a1daf7ada71c7c52b9

Evergreen Git git at git.evergreen-ils.org
Wed Feb 26 17:28:35 EST 2020


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  42939f1edc805adb63d4e2a1daf7ada71c7c52b9 (commit)
      from  975ef969e7236ef05f642e6f88159d6668712410 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 42939f1edc805adb63d4e2a1daf7ada71c7c52b9
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Fri Nov 22 18:05:10 2019 -0500

    LP#1853363: add SIP2 option patron_status_always_permit_loans
    
    This patch adds a new oils_sip.xml login attribute called
    patron_status_always_permit_loans that specifies whether
    the charge privileges denied, renewal privilges denied, and
    card reported lost flags in the patron status block should be
    coerced to permissive values regardless of the actual state
    of the patron record. Turning this on works around an issue
    where a 2019-12 change by the Hoopla SIP2 client takes those flag
    fields into account, but some libraries may not wish those
    to block a patron's access to online resources that use
    SIP2 to authenticate. This setting can also be set as
    an implementation_config option; note that if it is set to
    'true' or 'false' as a login attribute, the login attribute will
    override whatever is set in the implementation_config.
    
    To test
    -------
    [1] Set up a test system that has SIPServer running. Also set
        up a patron that either has a standing penalty blocking CIRC
        or renewals, expired privileges, and/or a lost primary card.
    [2] Perform a SIP2 patron information request (message 63) for
        the patron created in step 1. Note that the charge, renewal,
        and card lost flag fields in the SIP2 response should be set
        to indicated that privileges are denied.
    [3] Apply the patch and enable patron_status_always_permit_loans
        either as a login attribute or a implementation_config option;
        oils_sip.xml.example in this patch contains examples.
    [4] Repeat step 2; this time, the three flag fields should have
        permissive values (i.e., they will be set to the space character)
        regardless of the state of the patron record.
    
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
    Signed-off-by: Jason Boyer <JBoyer at eoli.info>
    Signed-off-by: Jeff Davis <jdavis at sitka.bclibraries.ca>

diff --git a/Open-ILS/examples/oils_sip.xml.example b/Open-ILS/examples/oils_sip.xml.example
index 06da91bec7..f0edf8897b 100644
--- a/Open-ILS/examples/oils_sip.xml.example
+++ b/Open-ILS/examples/oils_sip.xml.example
@@ -36,6 +36,20 @@
 		Specify which treatment you want in the av_format attribute.
 		For example: <login id="sc" password="pwd" institution="main" av_format="3m">
 		-->
+		<!--
+		The login attribute patron_status_always_permit_loans specifies whether
+		the charge privileges denied, renewal privilges denied, and
+		card reported lost flags in the patron status block should be
+		coerced to permissive values regardless of the actual state
+		of the patron record. Turning this on works around an issue
+		where a 2019-12 change by the Hoopla SIP2 client takes those flag
+		fields into account, but some libraries may not wish those
+		to block a patron's access to online resources that use
+		SIP2 to authenticate. This setting can also be set as
+		an implementation_config option; note that if it is set to
+		'true' or 'false' as a login attribute, the login attribute will
+		override whatever is set in the implementation_config.
+		-->
 		<login id="scclient" password="clientpwd" institution="gapines"/>
 	</accounts>
 
@@ -144,6 +158,11 @@
 					<option name='patron_calculate_recal_ok' value='true' />
 					-->
 
+					<!-- see description of patron_status_always_permit_loans in the login section -->
+					<!--
+					<option name='patron_status_always_permit_loans' value='false' />
+					-->
+
 				</options>
 
                 <checkin_override>
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm b/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm
index 98a594da84..16cff51aee 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm
@@ -328,6 +328,23 @@ sub language {
     return '000'; # Unspecified
 }
 
+# method to check to see if charge_ok, renew_ok, and
+# lost_card should be coerced to return a status indicating
+# that the patron should be allowed to circulate; this
+# implements a workaround further described in
+# https://bugs.launchpad.net/evergreen/+bug/1853363
+sub patron_status_always_permit_loans_set {
+    my $self = shift;
+
+    my $login = OpenILS::SIP->login_account();
+
+    return (
+                OpenILS::SIP::to_bool($login->{patron_status_always_permit_loans}) //
+                OpenILS::SIP::to_bool(OpenILS::SIP->get_option_value('patron_status_always_permit_loans'))
+           ) ||
+           0;
+}
+
 # How much more detail do we need to check here?
 # sec: adding logic to return false if user is barred, has a circulation block
 # or an expired card
@@ -336,6 +353,8 @@ sub charge_ok {
     my $u = $self->{user};
     my $circ_is_blocked = 0;
 
+    return 1 if $self->patron_status_always_permit_loans_set();
+
     # compute expiration date for borrowing privileges
     my $expire = DateTime::Format::ISO8601->new->parse_datetime(clean_ISO8601($u->expire_date));
 
@@ -355,6 +374,8 @@ sub renew_ok {
     my $u = $self->{user};
     my $renew_is_blocked = 0;
 
+    return 1 if $self->patron_status_always_permit_loans_set();
+
     # compute expiration date for borrowing privileges
     my $expire = DateTime::Format::ISO8601->new->parse_datetime(clean_ISO8601($u->expire_date));
 
@@ -398,6 +419,9 @@ sub hold_ok {
 # return true if the card provided is marked as lost
 sub card_lost {
     my $self = shift;
+
+    return 0 if $self->patron_status_always_permit_loans_set();
+
     return $self->{user}->card->active eq 'f';
 }
 
diff --git a/docs/RELEASE_NOTES_NEXT/SIP/Add_patron_status_always_permit_loans_SIP_option.adoc b/docs/RELEASE_NOTES_NEXT/SIP/Add_patron_status_always_permit_loans_SIP_option.adoc
new file mode 100644
index 0000000000..45c2d733ef
--- /dev/null
+++ b/docs/RELEASE_NOTES_NEXT/SIP/Add_patron_status_always_permit_loans_SIP_option.adoc
@@ -0,0 +1,15 @@
+Add patron_status_always_permit_loans Option to SIP Server
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Evergreen now has a new `oils_sip.xml` login attribute called
+`patron_status_always_permit_loans` that specifies whether
+the charge privileges denied, renewal privilges denied, and
+card reported lost flags in the patron status block should be
+coerced to permissive values regardless of the actual state
+of the patron record. Turning this on works around an issue
+where a 2019-12 change by the Hoopla SIP2 client takes those flag
+fields into account, but some libraries may not wish those
+to block a patron's access to online resources that use
+SIP2 to authenticate. This setting can also be set as
+an `implementation_config` option; note that if it is set to
+'true' or 'false' as a login attribute, the login attribute will
+override whatever is set in the `implementation_config`.

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/examples/oils_sip.xml.example             | 19 +++++++++++++++++
 Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm    | 24 ++++++++++++++++++++++
 ...tron_status_always_permit_loans_SIP_option.adoc | 15 ++++++++++++++
 3 files changed, 58 insertions(+)
 create mode 100644 docs/RELEASE_NOTES_NEXT/SIP/Add_patron_status_always_permit_loans_SIP_option.adoc


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list