// FIXME: This probably needs to be done in preprocess
if ($this->_action & CRM_Core_Action::UPDATE && CRM_Utils_Array::value('financial_type_id', $this->_values)) {
$financialTypeID = CRM_Contribute_PseudoConstant::financialType($this->_values['financial_type_id']);
- $lineItems = CRM_Price_BAO_LineItem::getLineItemsByContributionID($this->_id);
- foreach ($lineItems as $items) {
- if (!CRM_Core_Permission::check('edit contributions of type ' . CRM_Contribute_PseudoConstant::financialType($items['financial_type_id']))) {
- CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
- break;
- }
- }
+ CRM_Financial_BAO_FinancialType::checkPermissionedLineItems($this->_id, 'edit');
if (!CRM_Core_Permission::check('edit contributions of type ' . $financialTypeID)) {
CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
}