You are here

function farm_access_menu_alter in farmOS 7

Implements hook_menu_alter().

File

modules/farm/farm_access/farm_access.module, line 157
Farm Access module.

Code

function farm_access_menu_alter(&$items) {

  // Define a list of paths that will need to respond to OPTIONS requests
  // (eg: from Field Kit). Override their access callback to return TRUE for
  // OPTIONS requests, otherwise delegate to the original access callback.
  $paths = array(
    'farm/areas/geojson',
  );
  foreach ($paths as $path) {
    if (array_key_exists($path, $items)) {
      array_unshift($items[$path]['access arguments'], $items[$path]['access callback']);
      $items[$path]['access callback'] = 'farm_access_options_access_callback';
    }
  }
}