CRM-16526 CIVI-3 Added check only when check permissions is specified for lineitems
authorEdsel <edsel.lopez@jmaconsulting.biz>
Mon, 22 Feb 2016 11:56:30 +0000 (17:26 +0530)
committerPradeep Nayak <pradpnayak@gmail.com>
Mon, 22 Feb 2016 18:11:39 +0000 (23:41 +0530)
----------------------------------------
* CRM-16526: ACLs for Financial Types
  https://issues.civicrm.org/jira/browse/CRM-16526

CRM/Price/BAO/LineItem.php
api/v3/LineItem.php

index b813d3c3b90ec5acc9d28a0dd748a03c7988fc30..cb750b32bc60911e323fd03483d9c280b40c0016 100644 (file)
@@ -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');
       }
index e74175524edf2861602a4956f9c0a7286e9e28a5..3ed9556b4540423edbcca3cd67bc1c1d476b7c33 100644 (file)
@@ -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(