@@ -, +, @@ - set patron attribute to anything but "1" - delete the patron attribute - map the patron attribute to an authorized list, e.g. (YES_NO) and set it to a value that doesn't map to "1", e.g. "No". --- C4/SIP/Sip/MsgType.pm | 11 +++++++++++ etc/SIPconfig.xml | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) --- a/C4/SIP/Sip/MsgType.pm +++ a/C4/SIP/Sip/MsgType.pm @@ -940,6 +940,17 @@ sub handle_patron_info { $resp = (PATRON_INFO_RESP); if ($patron) { + # Bug 16694 - Limit SIP2 auth by patron attribute + # If login account has validate_patron_attribute set, it will check if patron has this attribute set + # If set to 1 or authorized value mapped to 1, allow access (charge and renewal privileges ok) + if ($server->{account}->{validate_patron_attribute}) { + my $attr = C4::Members::Attributes::GetBorrowerAttributeValue($patron->{borrowernumber}, $server->{account}->{validate_patron_attribute}); + if ($attr || $attr == "1") { + $patron->{charge_ok} = "1"; + $patron->{renew_ok} = "1"; + } + } + $resp .= patron_status_string($patron); $resp .= ( defined($lang) and length($lang) == 3 ) ? $lang : $patron->language; $resp .= timestamp(); --- a/etc/SIPconfig.xml +++ a/etc/SIPconfig.xml @@ -51,7 +51,8 @@ + av_field_template="[% accountline.description %] [% accountline.amountoutstanding | format('%.2f') %]" + validate_patron_attribute="sc-door-access" > --