From 37da0d3ad09aea090145db1c927e5c416b2c6887 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 1 Aug 2014 15:13:38 -0400 Subject: [PATCH] LP#1347774 CStoreEditor anon pcrud default to undef authtoken The presence of an authtoken ("ANONYMOUS") in the editor can be misleading at higher levels of the code, since it implies a presumably functional authtoken has been provided somewhow. Apply ANONYMOUS only as needed to API calls instead. Signed-off-by: Bill Erickson --- Open-ILS/src/perlmods/lib/OpenILS/Utils/CStoreEditor.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Utils/CStoreEditor.pm b/Open-ILS/src/perlmods/lib/OpenILS/Utils/CStoreEditor.pm index 11ed74ae80..87f11d0f50 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Utils/CStoreEditor.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Utils/CStoreEditor.pm @@ -214,7 +214,6 @@ sub died { sub authtoken { my( $self, $auth ) = @_; $self->{authtoken} = $auth if $auth; - return 'ANONYMOUS' if ($self->personality eq 'open-ils.pcrud' and !defined($self->{authtoken})); return $self->{authtoken}; } @@ -828,8 +827,9 @@ sub runmethod { my $obj; my $err = ''; - # In pcrud mode, sub authtoken returns 'ANONYMOUS' if one is not yet set - unshift(@arg, $self->authtoken) if ($self->personality eq 'open-ils.pcrud'); + # in PCRUD mode, if no authtoken is set, fall back to anonymous. + unshift(@arg, ($self->authtoken || 'ANONYMOUS')) + if ($self->personality eq 'open-ils.pcrud'); try { $obj = $self->request($method, @arg); -- 2.11.0