if (!is_array($names)) {
// We were called with the old contract wherein $names is actually an int.
// Symfony dispatcher requires some kind of name.
- Civi::log()->warning("hook_$fnSuffix should be updated to pass an array of parameter names to CRM_Utils_Hook::invoke().", ['civi.tag' => 'deprecated']);
+ CRM_Core_Error::deprecatedWarning("hook_$fnSuffix should be updated to pass an array of parameter names to CRM_Utils_Hook::invoke().");
$compatNames = ['arg1', 'arg2', 'arg3', 'arg4', 'arg5', 'arg6'];
$names = array_slice($compatNames, 0, (int) $names);
}
}
/**
- * This hook is called when loading CMS permissions; use this hook to modify
+ * This hook is called when exporting Civi's permission to the CMS. Use this hook to modify
* the array of system permissions for CiviCRM.
*
* @param array $permissions
);
}
+ /**
+ * This hook is used to enumerate the list of available permissions. It may
+ * include concrete permissions defined by Civi, concrete permissions defined
+ * by the CMS, and/or synthetic permissions.
+ *
+ * @param array $permissions
+ * Array of permissions, keyed by symbolic name. Each is an array with fields:
+ * - group: string (ex: "civicrm", "cms")
+ * - title: string (ex: "CiviEvent: Register for events")
+ * - description: string (ex: "Register for events online")
+ * - is_synthetic: bool (TRUE for synthetic permissions with a bespoke evaluation. FALSE for concrete permissions that registered+granted in the UF user-management layer.
+ * Default TRUE iff name begins with '@')
+ * - is_active: bool (TRUE if this permission is defined by. Default: TRUE)
+ *
+ * @return null
+ * The return value is ignored
+ * @see Civi\Api4\Permission::get()
+ */
+ public static function permissionList(&$permissions) {
+ return self::singleton()->invoke(['permissions'], $permissions,
+ self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject,
+ 'civicrm_permissionList'
+ );
+ }
+
/**
* This hook is called when checking permissions; use this hook to dynamically
* escalate user permissions in certain use cases (cf. CRM-19256).