From 0cde21e3738cb40c808732178c5e1f79445cfad9 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 11 Aug 2016 16:51:55 -0700 Subject: [PATCH] CRM-19223 - migrate/(export|import)JSON.php - Require "administer CiviCRM" --- bin/migrate/exportJSON.php | 6 +++++- bin/migrate/importJSON.php | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/bin/migrate/exportJSON.php b/bin/migrate/exportJSON.php index b09aff62b8..c9f8b422a5 100644 --- a/bin/migrate/exportJSON.php +++ b/bin/migrate/exportJSON.php @@ -40,7 +40,11 @@ function run() { $config = CRM_Core_Config::singleton(); // this does not return on failure - // CRM_Utils_System::authenticateScript( true ); + CRM_Utils_System::authenticateScript( true ); + if (!CRM_Core_Permission::check('administer CiviCRM')) { + CRM_Utils_System::authenticateAbort("User does not have required permission (administer CiviCRM).\n", TRUE); + } + $params = array(); require_once 'CRM/Utils/Migrate/ExportJSON.php'; diff --git a/bin/migrate/importJSON.php b/bin/migrate/importJSON.php index af4205a0d2..233d07df10 100644 --- a/bin/migrate/importJSON.php +++ b/bin/migrate/importJSON.php @@ -40,7 +40,10 @@ function run() { $config = CRM_Core_Config::singleton(); // this does not return on failure - // CRM_Utils_System::authenticateScript( true ); + CRM_Utils_System::authenticateScript( true ); + if (!CRM_Core_Permission::check('administer CiviCRM')) { + CRM_Utils_System::authenticateAbort("User does not have required permission (administer CiviCRM).\n", TRUE); + } require_once 'CRM/Utils/Migrate/ImportJSON.php'; $import = new CRM_Utils_Migrate_ImportJSON(); -- 2.25.1