From: Bill Erickson Date: Mon, 26 Mar 2012 14:25:25 +0000 (-0400) Subject: Check auth on flattener search calls X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=1857016d263752af452fbe123b14d4c355945332;p=working%2FEvergreen.git Check auth on flattener search calls Otherwise, the auth will fail at a lower level (pcrud) and result in sending a less-than-useful error message to the caller. Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Fielder.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Fielder.pm index 4342479755..3d9ae133ce 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Fielder.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Fielder.pm @@ -158,6 +158,9 @@ sub generate_methods { sub register_map { my ($self, $conn, $auth, $hint, $map) = @_; + my $e = new_editor(authtoken => $auth); + return $e->event unless $e->checkauth; + $key = 'flat_search_' . md5_hex( $hint . OpenSRF::Utils::JSON->perl2JSON( $map ) @@ -194,6 +197,9 @@ sub execute_registered_flattened_search { my $auth = shift; my $key = shift; + my $e = new_editor(authtoken => $auth); + return $e->event unless $e->checkauth; + my $blob = $cache->get_cache( $key ); flattened_search( $self, $conn, $auth, $blob->{hint}, $blob->{map}, @_ ) @@ -234,6 +240,9 @@ sub flattened_search { # All but the last argument really are necessary. $slo ||= {}; + my $e = new_editor(authtoken => $auth); + return $e->event unless $e->checkauth; + # Process the map to normalize it, and to get all our joins and fleshing # structure into the jffolo. my $jffolo;