You are here

function oa_tour_bootstrap_tour_access in Open Atrium Tours 7.2

Implements hook_bootstrap_tour_access().

File

./oa_tour.module, line 177
Code for the Open Atrium Bootstrap Tour customizations.

Code

function oa_tour_bootstrap_tour_access($tour, $account, $current_access) {
  if ($items = field_get_items('bootstrap_tour', $tour, 'field_bootstrap_tour_spaces')) {
    $space_context = oa_core_get_space_context();
    if (!$space_context) {
      return FALSE;
    }
    foreach ($items as $item) {
      if ($item['target_id'] == $space_context) {
        return TRUE;
      }
    }
    return FALSE;
  }
}