From: Bill Erickson Date: Fri, 1 Aug 2014 19:13:38 +0000 (-0400) Subject: LP#1347774 CStoreEditor anon pcrud default to undef authtoken X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=37da0d3ad09aea090145db1c927e5c416b2c6887;p=working%2FEvergreen.git 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 --- 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);