From ba9f6960bcab2418ac38f178e40f27f7b260a312 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 26 Oct 2011 14:56:01 -0400 Subject: [PATCH] Z39.50 service filter repairs Do not attempt to filter out Z39.50 services by permission when retrieveing the services in a non-authenticate manner (i.e. from within the Z39.50 code). Otherwise, the code will die on $e->requestor->id, because there is no requestor. Signed-off-by: Bill Erickson --- .../lib/OpenILS/Application/Search/Z3950.pm | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Z3950.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Z3950.pm index 6a095290e1..978b106e4c 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Z3950.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Z3950.pm @@ -157,16 +157,18 @@ sub fetch_service_defs { }; # then filter out any services which the requestor lacks the perm for - foreach my $s (keys %{ $hash }) { - if ($$hash{$s}{use_perm}) { - if ($U->check_perms( - $e->requestor->id, - $e->requestor->ws_ou, - $$hash{$s}{use_perm} - )) { - delete $$hash{$s}; - } - }; + if ($editor_with_authtoken) { + foreach my $s (keys %{ $hash }) { + if ($$hash{$s}{use_perm}) { + if ($U->check_perms( + $e->requestor->id, + $e->requestor->ws_ou, + $$hash{$s}{use_perm} + )) { + delete $$hash{$s}; + } + }; + } } %services = %$hash; # cache these internally so we can actually use the db-configured sources -- 2.11.0