本文整理汇总了PHP中CRM_ACL_BAO_Cache::build方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_ACL_BAO_Cache::build方法的具体用法?PHP CRM_ACL_BAO_Cache::build怎么用?PHP CRM_ACL_BAO_Cache::build使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_ACL_BAO_Cache
的用法示例。
在下文中一共展示了CRM_ACL_BAO_Cache::build方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: group
public static function group($type, $contactID = NULL, $tableName = 'civicrm_saved_search', $allGroups = NULL, $includedGroups = NULL)
{
$acls = CRM_ACL_BAO_Cache::build($contactID);
if (!empty($includedGroups) && is_array($includedGroups)) {
$ids = $includedGroups;
} else {
$ids = array();
}
if (!empty($acls)) {
$aclKeys = array_keys($acls);
$aclKeys = implode(',', $aclKeys);
$query = "\nSELECT a.operation, a.object_id\n FROM civicrm_acl_cache c, civicrm_acl a\n WHERE c.acl_id = a.id\n AND a.is_active = 1\n AND a.object_table = %1\n AND a.id IN ( {$aclKeys} )\nORDER BY a.object_id\n";
$params = array(1 => array($tableName, 'String'));
$dao = CRM_Core_DAO::executeQuery($query, $params);
while ($dao->fetch()) {
if ($dao->object_id) {
if (self::matchType($type, $dao->operation)) {
$ids[] = $dao->object_id;
}
} else {
// this user has got the permission for all objects of this type
// check if the type matches
if (self::matchType($type, $dao->operation)) {
foreach ($allGroups as $id => $dontCare) {
$ids[] = $id;
}
}
break;
}
}
}
CRM_Utils_Hook::aclGroup($type, $contactID, $tableName, $allGroups, $ids);
return $ids;
}