You are here

function commerce_file_license_field_config_delete_access in Commerce File 7

Access callback for field ui delete on license entities

1 string reference to 'commerce_file_license_field_config_delete_access'
commerce_file_menu_alter in ./commerce_file.module
Implements hook_menu_alter()

File

./commerce_file.module, line 127
Provides integration of file licenses with Commerce

Code

function commerce_file_license_field_config_delete_access($perm, $field_instance) {
  $non_deletable_fields = _commerce_file_get_field_names();

  // block delete for non-deletable fields
  if (isset($field_instance['field_name']) && in_array($field_instance['field_name'], $non_deletable_fields)) {
    return FALSE;
  }

  // fallback to user permission
  return user_access($perm);
}