DispatchPolicy - Actively report any upgrade problems with hook_civicrm_permission
[civicrm-core.git] / CRM / Upgrade / DispatchPolicy.php
index de0fa72511d554bb988d2100a4ea0eeae97f93d9..fa450cc2bb60d5a87ada67925e98a81fe9d48d33 100644 (file)
@@ -59,6 +59,8 @@ class CRM_Upgrade_DispatchPolicy {
     // It's more restrictive, preventing interference from unexpected callpaths.
     $policies['upgrade.main'] = [
       'hook_civicrm_config' => 'run',
+      // cleanupPermissions() in some UF's can be destructive. Running prematurely could be actively harmful.
+      'hook_civicrm_permission' => 'fail',
       '/^hook_civicrm_(pre|post)$/' => 'drop',
       '/^hook_civicrm_/' => $strict ? 'warn-drop' : 'drop',
       '/^civi\./' => 'run',