function farm_asset_autocomplete_access in farmOS 7
Access callback for the farm_asset autocomplete path.
Parameters
string $asset_type: The asset type to filter to, or "all" for no filtering.
Return value
bool Returns TRUE or FALSE to grant or deny access to the path.
1 string reference to 'farm_asset_autocomplete_access'
- farm_asset_menu in modules/
farm/ farm_asset/ farm_asset.module - Implements hook_menu().
File
- modules/
farm/ farm_asset/ farm_asset.module, line 682 - Farm asset - A farm asset entity type.
Code
function farm_asset_autocomplete_access($asset_type) {
if ($asset_type == 'all' || strpos($asset_type, '+') !== FALSE) {
return user_access('view farm assets');
}
return user_access('view any ' . $asset_type . ' farm assets');
}