Merge pull request #24022 from colemanw/afformFrontend
[civicrm-core.git] / CRM / Core / Permission / Base.php
index 60ffbe3c9ed6adc129811e0efbe3627e121560d2..9b1ae5709bbcfa3486bfe22485ba5a401efe33ef 100644 (file)
@@ -75,10 +75,10 @@ class CRM_Core_Permission_Base {
   }
 
   /**
-   * Get the current permission of this user.
+   * Get the maximum permission of the current user with respect to _any_ contact records.
    *
-   * @return string
-   *   the permission of the user (edit or view or null)
+   * @return int|string|null
+   * @see \CRM_Core_Permission::getPermission()
    */
   public function getPermission() {
     $this->group();
@@ -393,15 +393,13 @@ class CRM_Core_Permission_Base {
    * in all enabled CiviCRM module extensions.
    *
    * @param bool $descriptions
-   * @param array $permissions
    *
    * @return array
    *   Array of permissions, in the same format as CRM_Core_Permission::getCorePermissions().
    */
-  public function getAllModulePermissions($descriptions = FALSE, &$permissions): array {
-    $newPermissions = [];
-    CRM_Utils_Hook::permission($newPermissions, $permissions);
-    $permissions = array_merge($permissions, $newPermissions);
+  public function getAllModulePermissions($descriptions = FALSE): array {
+    $permissions = [];
+    CRM_Utils_Hook::permission($permissions);
 
     if ($descriptions) {
       foreach ($permissions as $permission => $label) {