From 7ce074abb17e1512df87c38f2eb4fb869782ae81 Mon Sep 17 00:00:00 2001 From: larssandergreen Date: Mon, 12 Jun 2023 11:47:44 -0600 Subject: [PATCH] Make implicit TRUE permissions check explicit in API 4 Explorer for PHP --- ang/api4Explorer/Explorer.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ang/api4Explorer/Explorer.js b/ang/api4Explorer/Explorer.js index 5f031ca28b..a5629119a8 100644 --- a/ang/api4Explorer/Explorer.js +++ b/ang/api4Explorer/Explorer.js @@ -734,6 +734,8 @@ break; case 'php': + // Always shows implicit true permissions check for PHP + params.checkPermissions = (params.checkPermissions === false) ? false : true; // Write php code code.php = '$' + results + " = civicrm_api4('" + entity + "', '" + action + "', ["; _.each(params, function(param, key) { @@ -876,9 +878,8 @@ newLine = "\n" + _.repeat(' ', indent), code = '\\' + info.class + '::' + action + '(', args = _.cloneDeep(info.class_args || []); - if (params.checkPermissions === false) { - args.push(false); - } + // Always shows implicit true permissions check for PHP + args.push((params.checkPermissions === false) ? false : true); code += _.map(args, phpFormat).join(', ') + ')'; _.each(params, function(param, key) { var val = ''; -- 2.25.1