Skip to content

Commit

Permalink
Merge pull request #15603 from seamuslee001/nfc_acl_doc_block_update
Browse files Browse the repository at this point in the history
[NFC] dev/core#1336 Update doc blocks for various ACL related functions
  • Loading branch information
eileenmcnaughton authored Oct 25, 2019
2 parents 096b176 + 5b27235 commit 4fef665
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
17 changes: 12 additions & 5 deletions CRM/ACL/BAO/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ class CRM_ACL_BAO_Cache extends CRM_ACL_DAO_ACLCache {
public static $_cache = NULL;

/**
* @param int $id
* Build an array of ACLs for a specific ACLed user
* @param int $id - contact_id of the ACLed user
*
* @return mixed
*/
Expand Down Expand Up @@ -91,8 +92,10 @@ public static function retrieve($id) {
}

/**
* @param int $id
* @param array $cache
* Store ACLs for a specific user in the `civicrm_acl_cache` table
* @param int $id - contact_id of the ACLed user
* @param array $cache - key civicrm_acl.id - values is the details of the ACL.
*
*/
public static function store($id, &$cache) {
foreach ($cache as $aclID => $data) {
Expand All @@ -109,7 +112,9 @@ public static function store($id, &$cache) {
}

/**
* @param int $id
* Remove entries from civicrm_acl_cache for a specified ACLed user
* @param int $id - contact_id of the ACLed user
*
*/
public static function deleteEntry($id) {
if (self::$_cache &&
Expand All @@ -127,7 +132,9 @@ public static function deleteEntry($id) {
}

/**
* @param int $id
* Update ACL caches `civicrm_acl_cache` and `civicrm_acl_contact_cache for the specified ACLed user
* @param int $id - contact_id of ACLed user to update caches for.
*
*/
public static function updateEntry($id) {
// rebuilds civicrm_acl_cache
Expand Down
8 changes: 4 additions & 4 deletions CRM/Contact/BAO/Contact/Permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,12 @@ public static function allow($id, $type = CRM_Core_Permission::VIEW) {
}

/**
* Fill the acl contact cache for this contact id if empty.
* Fill the acl contact cache for this ACLed contact id if empty.
*
* @param int $userID
* @param int $userID - contact_id of the ACLed user
* @param int|string $type the type of operation (view|edit)
* @param bool $force
* Should we force a recompute.
* @param bool $force - Should we force a recompute.
*
*/
public static function cache($userID, $type = CRM_Core_Permission::VIEW, $force = FALSE) {
// FIXME: maybe find a better way of keeping track of this. @eileen pointed out
Expand Down

0 comments on commit 4fef665

Please sign in to comment.