From 2b2054e6948477a94408f96c08e4621ae2d2d8ed 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 Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- 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.39.5