Do not run financial acls if the setting it not set
authorEileen McNaughton <emcnaughton@wikimedia.org>
Wed, 11 Oct 2023 00:36:22 +0000 (13:36 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Wed, 11 Oct 2023 00:36:22 +0000 (13:36 +1300)
Yeah - continues a fugly fix - but it's quick & works

ext/financialacls/financialacls.php

index 48b93922b32a2567fd528d42e57a5c22dabaa486..5696c289f275dfc6a64ddefa3d6f6277710df669 100644 (file)
@@ -391,6 +391,9 @@ function financialacls_civicrm_alterMenu(array &$menu): void {
  * Implements hook_civicrm_links()
  */
 function financialacls_civicrm_links(string $op, ?string $objectName, $objectID, array &$links, ?int &$mask, array &$values) {
+  if (!financialacls_is_acl_limiting_enabled()) {
+    return;
+  }
   if ($objectName === 'MembershipType') {
     $financialType = CRM_Core_PseudoConstant::getName('CRM_Member_BAO_MembershipType', 'financial_type_id', CRM_Member_BAO_MembershipType::getMembershipType($objectID)['financial_type_id']);
     $hasEditPermission = CRM_Core_Permission::check('edit contributions of type ' . $financialType);