From: colemanw Date: Mon, 27 Nov 2023 21:10:58 +0000 (-0500) Subject: UserJob - Fix deprecated syntax in addSelectWhereClause X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=7607b213e7efb2d691e5b989f9d83268aba313e8;p=civicrm-core.git UserJob - Fix deprecated syntax in addSelectWhereClause --- 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;