Skip to content
Snippets Groups Projects
Unverified Commit f3bc780b authored by Eileen McNaughton's avatar Eileen McNaughton Committed by GitHub
Browse files

Merge pull request #30054 from colemanw/fixSavingSearch

SearchKit - Fix saving search displays with 'Bypass Permissions'
parents 018d0131 44a6ae20
Branches
Tags
No related merge requests found
......@@ -49,7 +49,7 @@ class CRM_Search_BAO_SearchDisplay extends CRM_Search_DAO_SearchDisplay implemen
}
// Ensure only super-admins may update SavedSearches linked to displays with `acl_bypass`
elseif ($recordType === 'SavedSearch' && $e->getActionName() === 'update') {
if ($recordType === 'SavedSearch' && $e->getActionName() === 'update' && !CRM_Core_Permission::check('all CiviCRM permissions and ACLs', $userCID)) {
$id = (int) $e->getRecord()['id'];
$sql = "SELECT COUNT(id) FROM civicrm_search_display WHERE acl_bypass = 1 AND saved_search_id = $id";
if (CRM_Core_DAO::singleValueQuery($sql)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment