Skip to content

Commit

Permalink
Merge pull request #12449 from colemanw/gettree
Browse files Browse the repository at this point in the history
CustomValue gettree api - More accurate permission check
  • Loading branch information
colemanw authored Jul 12, 2018
2 parents cab4858 + f26fa70 commit 2344e6e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CRM/Core/Permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -1473,6 +1473,10 @@ public static function getEntityActionPermissions() {
$permissions['option_value'] = $permissions['uf_group'];
$permissions['option_group'] = $permissions['option_value'];

$permissions['custom_value'] = array(
'gettree' => array('access CiviCRM'),
);

$permissions['message_template'] = array(
'get' => array('access CiviCRM'),
'create' => array('edit message templates', 'edit user-driven message templates', 'edit system workflow message templates'),
Expand Down
1 change: 1 addition & 0 deletions api/v3/CustomValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ function civicrm_api3_custom_value_gettree($params) {
if ($ret || !empty($params['check_permissions'])) {
$entityData = civicrm_api3($params['entity_type'], 'getsingle', array(
'id' => $params['entity_id'],
'check_permissions' => !empty($params['check_permissions']),
'return' => array_merge(array('id'), array_values($ret)),
));
foreach ($ret as $param => $key) {
Expand Down

0 comments on commit 2344e6e

Please sign in to comment.