From: Kyle Tomita Date: Tue, 26 Mar 2013 18:49:08 +0000 (-0700) Subject: Fix reversed logic for hold "blob" notes X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fcatalystit%2Flp1109316-signoff;p=working%2FEvergreen.git Fix reversed logic for hold "blob" notes Hold notes (at least at the data level) allow for both staff and "private" notes to be attached. This code intended to show "private" notes to the hold owner and staff notes to staff, but had the logic reversed. Allow access to public hold notes via hold "blob" If a hold note is marked as "public", it seems reasonable that it should be visible to anyone who can see that hold, regardless of who created the note. Signed-off-by: Dan Wells Signed-off-by: Kyle Tomita --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm index 1d32a03d0b..8e7e5f7f04 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm @@ -3252,16 +3252,16 @@ sub uber_hold_impl { ) or return $e->event; if($hold->usr->id ne $e->requestor->id) { - # A user is allowed to see his/her own holds + # caller is asking for someone else's hold $e->allowed('VIEW_HOLD') or return $e->event; - $hold->notes( # filter out any non-staff ("private") notes - [ grep { !$U->is_true($_->staff) } @{$hold->notes} ] ); + $hold->notes( # filter out any non-staff ("private") notes (unless marked as public) + [ grep { $U->is_true($_->staff) or $U->is_true($_->pub) } @{$hold->notes} ] ); } else { # caller is asking for own hold, but may not have permission to view staff notes unless($e->allowed('VIEW_HOLD')) { - $hold->notes( # filter out any staff notes - [ grep { $U->is_true($_->staff) } @{$hold->notes} ] ); + $hold->notes( # filter out any staff notes (unless marked as public) + [ grep { !$U->is_true($_->staff) or $U->is_true($_->pub) } @{$hold->notes} ] ); } }