From 919be706466d031b2ec33af8d5dc7c845917a688 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 19 May 2021 16:03:48 -0400 Subject: [PATCH] SearchKit - Sync menu & navigation permissions to use 'administer CiviCRM data' Fixes dev/core#2619 https://lab.civicrm.org/dev/core/-/issues/2619 --- ext/search_kit/CRM/Search/Upgrader.php | 11 +++++++++++ ext/search_kit/xml/Menu/search_kit.xml | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ext/search_kit/CRM/Search/Upgrader.php b/ext/search_kit/CRM/Search/Upgrader.php index 3f6de4d5ee..31c06e64ca 100644 --- a/ext/search_kit/CRM/Search/Upgrader.php +++ b/ext/search_kit/CRM/Search/Upgrader.php @@ -18,6 +18,7 @@ class CRM_Search_Upgrader extends CRM_Search_Upgrader_Base { ->addValue('icon', 'crm-i fa-search-plus') ->addValue('has_separator', 2) ->addValue('weight', 99) + ->addValue('permission', 'administer CiviCRM data') ->execute(); } @@ -133,4 +134,14 @@ class CRM_Search_Upgrader extends CRM_Search_Upgrader_Base { return TRUE; } + /** + * Upgrade 1004 - fix menu permission. + * @return bool + */ + public function upgrade_1004() { + $this->ctx->log->info('Applying update 1000 - fix menu permission.'); + CRM_Core_DAO::executeQuery("UPDATE civicrm_navigation SET permission = 'administer CiviCRM data' WHERE url = 'civicrm/admin/search'"); + return TRUE; + } + } diff --git a/ext/search_kit/xml/Menu/search_kit.xml b/ext/search_kit/xml/Menu/search_kit.xml index 168defc411..eb53c32709 100644 --- a/ext/search_kit/xml/Menu/search_kit.xml +++ b/ext/search_kit/xml/Menu/search_kit.xml @@ -8,6 +8,6 @@ civicrm/admin/search CRM_Search_Page_Admin - administer CiviCRM + administer CiviCRM data -- 2.25.1