function feeds_access in Feeds 8.2
Same name and namespace in other branches
- 6 feeds.module \feeds_access()
- 7.2 feeds.module \feeds_access()
- 7 feeds.module \feeds_access()
Menu access callback.
Parameters
$action: The action to be performed. Possible values are:
- import
- clear
- unlock
$param: Node object or FeedsImporter id.
Related topics
1 call to feeds_access()
- feeds_file_download in ./
feeds.module - Implements hook_file_download().
1 string reference to 'feeds_access'
- feeds_menu in ./
feeds.module - Implements hook_menu().
File
- ./
feeds.module, line 422 - Feeds - basic API functions and hook implementations.
Code
function feeds_access($action, $param) {
if (!in_array($action, array(
'import',
'clear',
'unlock',
))) {
// If $action is not one of the supported actions, we return access denied.
return FALSE;
}
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;
}