You are here

function feeds_access in Feeds 7

Same name and namespace in other branches
  1. 8.2 feeds.module \feeds_access()
  2. 6 feeds.module \feeds_access()
  3. 7.2 feeds.module \feeds_access()

Menu access callback.

Parameters

$action: One of 'import' or 'clear'.

$param: Node object or FeedsImporter id.

Related topics

1 string reference to 'feeds_access'
feeds_menu in ./feeds.module
Implements hook_menu().

File

./feeds.module, line 253
Feeds - basic API functions and hook implementations.

Code

function feeds_access($action, $param) {
  if (is_string($param)) {
    $importer_id = $param;
  }
  elseif ($param->type) {
    $importer_id = feeds_get_importer_id($param->type);
  }

  // Check for permissions if feed id is present, otherwise return FALSE.
  if ($importer_id) {
    if (user_access('administer feeds') || user_access($action . ' ' . $importer_id . ' feeds')) {
      return TRUE;
    }
  }
  return FALSE;
}