From d71e01f3758e1c64078f3e924ba43dc9b8f409cb Mon Sep 17 00:00:00 2001 From: tristan-orourke Date: Fri, 2 Aug 2024 14:16:12 -0400 Subject: [PATCH] Avoid passing array into `user->isAbleTo` (#11145) (cherry picked from commit 19962f88245d978f478ff7d626f2146e34041089) --- api/app/Models/PoolCandidate.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/api/app/Models/PoolCandidate.php b/api/app/Models/PoolCandidate.php index ac9b6a76bb9..43ef0c5b9c8 100644 --- a/api/app/Models/PoolCandidate.php +++ b/api/app/Models/PoolCandidate.php @@ -754,11 +754,9 @@ public function scopeAuthorizedToView(Builder $query) return $query->where('id', null); } - $hasSomePermission = $user->isAbleTo([ - 'view-own-application', - 'view-team-submittedApplication', - 'view-any-submittedApplication', - ]); + $hasSomePermission = $user->isAbleTo('view-own-application') + || $user->isAbleTo('view-team-submittedApplication') + || $user->isAbleTo('view-any-submittedApplication'); // User does not have any of the required permissions if (! $hasSomePermission) {