From 4e3ffa7ee0d21ad3192e8c8ba83f6695512960fc Mon Sep 17 00:00:00 2001 From: Jon Goldberg Date: Mon, 8 Jul 2019 14:53:03 -0400 Subject: [PATCH] reduce permissions to edit grant budget --- annualgrantbudgets.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/annualgrantbudgets.php b/annualgrantbudgets.php index 0f8c110..086dfd2 100644 --- a/annualgrantbudgets.php +++ b/annualgrantbudgets.php @@ -238,3 +238,9 @@ function annualgrantbudgets_civicrm_validateForm($formName, &$fields, &$files, & $errors = array_merge($errors, $budgetErrors); } } + +function annualgrantbudgets_civicrm_alterAPIPermissions($entity, $action, &$params, &$permissions) { + // Editing the budget should be possible with just "Access CiviGrant". + $permissions['grant_budget']['create'] = array('access CiviGrant'); + $permissions['grant_budget']['update'] = array('access CiviGrant'); +}