From 9175a3687f4973d3b32eee20f4b5d1f2e0862d1a Mon Sep 17 00:00:00 2001 From: colemanw Date: Mon, 27 Nov 2023 16:10:58 -0500 Subject: [PATCH] UserJob - Fix deprecated syntax in addSelectWhereClause --- CRM/Core/BAO/UserJob.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CRM/Core/BAO/UserJob.php b/CRM/Core/BAO/UserJob.php index a6ba558f83..8f572fa54d 100644 --- a/CRM/Core/BAO/UserJob.php +++ b/CRM/Core/BAO/UserJob.php @@ -154,10 +154,9 @@ class CRM_Core_BAO_UserJob extends CRM_Core_DAO_UserJob implements HookInterface */ public function addSelectWhereClause(string $entityName = NULL, int $userId = NULL, array $conditions = []): array { $clauses = []; - if (!\CRM_Core_Permission::check('administer queues')) { - // @todo - the is_template should really be prefixed. We need to add support - // for that in the compiler & then this would be `{table}.is_template` - $clauses['created_id'] = '= ' . (int) CRM_Core_Session::getLoggedInContactID() . ' OR is_template = 1'; + if (!\CRM_Core_Permission::check('administer queues', $userId)) { + // Only allow access to users' own jobs (or templates) + $clauses['created_id'][] = '= ' . (int) CRM_Core_Session::getLoggedInContactID() . ' OR {is_template} = 1'; } CRM_Utils_Hook::selectWhereClause($this, $clauses, $userId, $conditions); return $clauses; -- 2.25.1