From 4aed5ac039617c54c9319a7e7391543807becfc8 Mon Sep 17 00:00:00 2001 From: Edsel Date: Mon, 16 Mar 2015 19:41:05 +0530 Subject: [PATCH] CIVI-28 Added permissions for Drupal permission pages --- CRM/Financial/BAO/FinancialType.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CRM/Financial/BAO/FinancialType.php b/CRM/Financial/BAO/FinancialType.php index aa347c9082..ad4fea8246 100644 --- a/CRM/Financial/BAO/FinancialType.php +++ b/CRM/Financial/BAO/FinancialType.php @@ -188,4 +188,21 @@ class CRM_Financial_BAO_FinancialType extends CRM_Financial_DAO_FinancialType { return $financialType; } + /** + * adding permissions for financial types + * + * + * @param array $permissions an array of permissions + */ + public static function permissionedFinancialTypes(&$permissions) { + $financialTypes = CRM_Contribute_PseudoConstant::financialType(); + $prefix = ts('CiviCRM') . ': '; + foreach ($financialTypes as $id => $type) { + $permissions['add new contributions of type ' . $type] = $prefix . ts('add new contributions of type ' . $type); + $permissions['view contributions of type ' . $type] = $prefix . ts('view contributions of type ' . $type); + $permissions['edit contributions of type ' . $type] = $prefix . ts('edit contributions of type ' . $type); + $permissions['delete contributions of type ' . $type] = $prefix . ts('delete contributions of type ' . $type); + } + $permissions['administer CiviCRM Financial Types'] = $prefix . ts('administer CiviCRM Financial Types'); + } } -- 2.25.1