From: Jeff Davis Date: Tue, 14 Apr 2020 17:41:26 +0000 (-0700) Subject: LP#1777677: restrict allowable hooks for test notifications X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b68eca184d8172cacc659f1011927ca17a519d18;p=Evergreen.git LP#1777677: restrict allowable hooks for test notifications The open-ils.actor.event.test_notification API call should only support the au.email.test and au.sms_text.test hooks. Signed-off-by: Jeff Davis Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm index 3b39d398f3..5d85c7994c 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm @@ -4368,8 +4368,9 @@ sub fire_test_notification { } my $event_hook = $$args{hook} or return $e->event; - my $usr = $e->retrieve_actor_user($$args{target}); + return $e->event unless ($event_hook eq 'au.email.test' or $event_hook eq 'au.sms_text.test'); + my $usr = $e->retrieve_actor_user($$args{target}); return $e->event unless $usr; return $U->fire_object_event(undef, $event_hook, $usr, $e->requestor->ws_ou);