From 1857016d263752af452fbe123b14d4c355945332 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 26 Mar 2012 10:25:25 -0400 Subject: [PATCH] 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 --- Open-ILS/src/perlmods/lib/OpenILS/Application/Fielder.pm | 9 +++++++++ 1 file changed, 9 insertions(+) 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; -- 2.11.0