You are here

function sf_entity_salesforce_form_access in Salesforce Suite 7.2

Same name and namespace in other branches
  1. 7 sf_entity/sf_entity.module \sf_entity_salesforce_form_access()

Access callback for the Salesforce tab on entities.

Parameters

$entity_type:

$entity:

Return value

TRUE if the user has access, FALSE otherwise

1 string reference to 'sf_entity_salesforce_form_access'
sf_entity_menu in sf_entity/sf_entity.module
Implements hook_menu(). Creates a %/salesforce menu callback for all fieldable entities.

File

sf_entity/sf_entity.module, line 88
Integrates fieldable entities with the Salesforce API.

Code

function sf_entity_salesforce_form_access($entity_type, $entity = NULL) {
  if (isset($entity_type) && isset($entity)) {
    list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);
    return user_access('administer salesforce') and salesforce_api_fieldmap_options($entity_type, $bundle);
  }
  return FALSE;
}