+ // Now check for lineItems
+ $lineItems = CRM_Price_BAO_LineItem::getLineItemsByContributionID($result->id);
+ foreach ($lineItems as $items) {
+ if (!CRM_Core_Permission::check('view contributions of type ' . CRM_Contribute_PseudoConstant::financialType($items['financial_type_id']))) {
+ $checkLineItem = TRUE;
+ break;
+ }
+ if (!CRM_Core_Permission::check('edit contributions of type ' . CRM_Contribute_PseudoConstant::financialType($items['financial_type_id']))) {
+ unset($links[CRM_Core_Action::UPDATE]);
+ break;
+ }
+ if (!CRM_Core_Permission::check('delete contributions of type ' . CRM_Contribute_PseudoConstant::financialType($items['financial_type_id']))) {
+ unset($links[CRM_Core_Action::DELETE]);
+ break;
+ }
+ }
+ if ($checkLineItem) {
+ continue;
+ }
+ if (!CRM_Core_Permission::check('edit contributions of type ' . CRM_Contribute_PseudoConstant::financialType($result->financial_type_id))) {
+ unset($links[CRM_Core_Action::UPDATE]);
+ }
+ if (!CRM_Core_Permission::check('delete contributions of type ' . CRM_Contribute_PseudoConstant::financialType($result->financial_type_id))) {
+ unset($links[CRM_Core_Action::DELETE]);
+ }