* @return array of permissions to check for this entity-action combo
*/
function _civicrm_api3_permissions($entity, $action, &$params) {
- $entity = strtolower($entity);
+ $entity = _civicrm_api_get_entity_name_from_camel($entity);
$action = strtolower($action);
/**
*
* @param string $entity entity name in various formats e.g. Contribution, contribution, OptionValue, option_value, UFJoin, uf_join
* @return string $entity entity name in underscore separated format
+ *
+ * FIXME: Why isn't this called first thing in civicrm_api wrapper?
*/
function _civicrm_api_get_entity_name_from_camel($entity) {
if ($entity == strtolower($entity)) {