Пример #1
0
 /**
  * Get all the groups the user has access to for the given operation.
  *
  * @param int $type
  *   The type of permission needed.
  * @param int $contactID
  *   The contactID for whom the check is made.
  *
  * @param string $tableName
  * @param null $allGroups
  * @param null $includedGroups
  *
  * @return array
  *   the ids of the groups for which the user has permissions
  */
 public static function group($type, $contactID = NULL, $tableName = 'civicrm_saved_search', $allGroups = NULL, $includedGroups = NULL)
 {
     if ($contactID == NULL) {
         $session = CRM_Core_Session::singleton();
         $contactID = $session->get('userID');
     }
     if (!$contactID) {
         // anonymous user
         $contactID = 0;
     }
     return CRM_ACL_BAO_ACL::group($type, $contactID, $tableName, $allGroups, $includedGroups);
 }
Пример #2
0
 /**
  * get all the groups the user has access to for the given operation
  *
  * @param int $type the type of permission needed
  * @param int    $contactID the contactID for whom the check is made
  *
  * @return array the ids of the groups for which the user has permissions
  * @access public
  */
 public static function group($type, $contactID = null, $tableName = 'civicrm_saved_search', $allGroups = null, $includedGroups = null)
 {
     if ($contactID == null) {
         $session = CRM_Core_Session::singleton();
         $contactID = $session->get('userID');
     }
     if (!$contactID) {
         $contactID = 0;
         // anonymous user
     }
     require_once 'CRM/ACL/BAO/ACL.php';
     return CRM_ACL_BAO_ACL::group($type, $contactID, $tableName, $allGroups, $includedGroups);
 }
Пример #3
0
 /**
  * Get all the groups the user has access to for the given operation.
  *
  * @param int $type
  *   The type of permission needed.
  * @param int $contactID
  *   The contactID for whom the check is made.
  *
  * @param string $tableName
  * @param null $allGroups
  * @param null $includedGroups
  *
  * @return array
  *   the ids of the groups for which the user has permissions
  */
 public static function group($type, $contactID = NULL, $tableName = 'civicrm_saved_search', $allGroups = NULL, $includedGroups = NULL)
 {
     if ($contactID == NULL) {
         $contactID = CRM_Core_Session::getLoggedInContactID();
     }
     if (!$contactID) {
         // anonymous user
         $contactID = 0;
     }
     return CRM_ACL_BAO_ACL::group($type, $contactID, $tableName, $allGroups, $includedGroups);
 }