From f1fd4f5b2161f01b54a3955d9654060f9586da48 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 8 Mar 2019 15:10:20 +0000 Subject: [PATCH] Bug 22483: (QA follow-up) Tweaking call to haspermission This patch tweaks the logic to check the permissions is defined before passing to haspermission. Signed-off-by: Martin Renvoize --- Koha/REST/V1/Auth.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/REST/V1/Auth.pm b/Koha/REST/V1/Auth.pm index 92cafc22f2..53c6bacfc9 100644 --- a/Koha/REST/V1/Auth.pm +++ b/Koha/REST/V1/Auth.pm @@ -229,7 +229,7 @@ sub authenticate_api_request { my $permissions = $authorization->{'permissions'}; # Check if the user is authorized - if ( haspermission($user->userid, $permissions) + if ( ( defined($permissions) and haspermission($user->userid, $permissions) ) or allow_owner($c, $authorization, $user) or allow_guarantor($c, $authorization, $user) ) { -- 2.20.1