From 93b21909752fa3ba76cd2dca83b0c20f875ab22c Mon Sep 17 00:00:00 2001 From: Edsel Date: Mon, 22 Feb 2016 17:26:30 +0530 Subject: [PATCH] CRM-16526 CIVI-3 Added check only when check permissions is specified for lineitems ---------------------------------------- * CRM-16526: ACLs for Financial Types https://issues.civicrm.org/jira/browse/CRM-16526 --- CRM/Price/BAO/LineItem.php | 2 +- api/v3/LineItem.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CRM/Price/BAO/LineItem.php b/CRM/Price/BAO/LineItem.php index b813d3c3b9..cb750b32bc 100644 --- a/CRM/Price/BAO/LineItem.php +++ b/CRM/Price/BAO/LineItem.php @@ -69,7 +69,7 @@ class CRM_Price_BAO_LineItem extends CRM_Price_DAO_LineItem { if ($id) { unset($params['entity_id'], $params['entity_table']); } - if (CRM_Financial_BAO_FinancialType::isACLFinancialTypeStatus()) { + if (CRM_Financial_BAO_FinancialType::isACLFinancialTypeStatus() && CRM_Utils_Array::value('check_permissions', $params)) { if (empty($params['financial_type_id'])) { throw new Exception('Mandatory key(s) missing from params array: financial_type_id'); } diff --git a/api/v3/LineItem.php b/api/v3/LineItem.php index e74175524e..3ed9556b45 100644 --- a/api/v3/LineItem.php +++ b/api/v3/LineItem.php @@ -75,7 +75,7 @@ function _civicrm_api3_line_item_create_spec(&$params) { * Array of matching line_items */ function civicrm_api3_line_item_get($params) { - if (CRM_Financial_BAO_FinancialType::isACLFinancialTypeStatus()) { + if (CRM_Financial_BAO_FinancialType::isACLFinancialTypeStatus() && CRM_Utils_Array::value('check_permissions', $params)) { CRM_Financial_BAO_FinancialType::getAvailableFinancialTypes($types); if (empty($params['financial_type_id'])) { $params['financial_type_id'] = array('IN' => array_keys($types)); @@ -107,7 +107,7 @@ function civicrm_api3_line_item_get($params) { * API result array */ function civicrm_api3_line_item_delete($params) { - if (CRM_Financial_BAO_FinancialType::isACLFinancialTypeStatus()) { + if (CRM_Financial_BAO_FinancialType::isACLFinancialTypeStatus() && CRM_Utils_Array::value('check_permissions', $params)) { CRM_Financial_BAO_FinancialType::getAvailableFinancialTypes($types, CRM_Core_Action::DELETE); if (empty($params['financial_type_id'])) { $params['financial_type_id'] = civicrm_api3('LineItem', 'getvalue', array( -- 2.25.1