Skip to content

Commit

Permalink
Merge pull request #26514 from larssandergreen/Always-show-implicit-T…
Browse files Browse the repository at this point in the history
…RUE-Permissions-Check-in-API-4-Explorer

Make implicit TRUE permissions check explicit in API 4 Explorer for PHP
  • Loading branch information
colemanw authored Jun 12, 2023
2 parents af75c65 + 7ce074a commit f113935
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ang/api4Explorer/Explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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 = '';
Expand Down

0 comments on commit f113935

Please sign in to comment.