Skip to content

Commit

Permalink
Merge pull request #26054 from colemanw/hookDoc
Browse files Browse the repository at this point in the history
[NFC] Hook - Clarify param docs for hook_civicrm_aclGroup
  • Loading branch information
eileenmcnaughton authored Apr 12, 2023
2 parents df17c04 + c022823 commit b56074a
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions CRM/Utils/Hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -589,27 +589,28 @@ public static function aclWhereClause($type, &$tables, &$whereTables, &$contactI
}

/**
* This hook is called when composing the ACL where clause to restrict
* visibility of contacts to the logged in user
* Called when restricting access to contact-groups or custom_field-groups or profile-groups.
*
* @param int $type
* The type of permission needed.
* @param int $action
* Current action e.g. CRM_ACL_API::VIEW or CRM_ACL_API::EDIT
* @param int $contactID
* The contactID for whom the check is made.
* User contactID for whom the check is made.
* @param string $tableName
* The tableName which is being permissioned.
* @param array $allGroups
* The set of all the objects for the above table.
* @param array $currentGroups
* The set of objects that are currently permissioned for this contact.
* Table name of group, e.g. `civicrm_uf_group` or `civicrm_custom_group`.
* Note: for some weird reason when this hook is called for contact groups, this
* value will be `civicrm_saved_search` instead of `civicrm_group` as you'd expect.
* @param int[] $allGroups
* The ids of all groups from the above table.
* @param int[] $currentGroups
* The ids of allowed groups which may be altered by reference.
*
* @return null
* the return value is ignored
*/
public static function aclGroup($type, $contactID, $tableName, &$allGroups, &$currentGroups) {
public static function aclGroup($action, $contactID, $tableName, &$allGroups, &$currentGroups) {
$null = NULL;
return self::singleton()
->invoke(['type', 'contactID', 'tableName', 'allGroups', 'currentGroups'], $type, $contactID, $tableName, $allGroups, $currentGroups, $null, 'civicrm_aclGroup');
->invoke(['type', 'contactID', 'tableName', 'allGroups', 'currentGroups'], $action, $contactID, $tableName, $allGroups, $currentGroups, $null, 'civicrm_aclGroup');
}

/**
Expand Down

0 comments on commit b56074a

Please sign in to comment.