From 19b2a0fe97be0e457c7f03b40cab47ac83d95ce3 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 3012412b03..1040afc180 100644 --- a/bin/migrate/exportJSON.php +++ b/bin/migrate/exportJSON.php @@ -38,7 +38,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 18a5c02404..21a23b2556 100644 --- a/bin/migrate/importJSON.php +++ b/bin/migrate/importJSON.php @@ -38,7 +38,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