Here's how to have it work with the Term Reference Tree widget. Without this code, a check will be done on form validation, but the options list will contain unavailable terms, which is not user-friendly at all.
I don't submit a patch because I made it quickly for my needs on the stable version.

/**
 * Implements hook_field_widget_WIDGET_TYPE_form_alter().
 *
 * This implements the create grant for term reference tree widgets.
 */
function taxonomy_access_field_widget_term_reference_tree_form_alter(&$element, &$form_state, $context) {
  // We need to act later because the options array is not built yet.
  $element['#after_build'][] = '_taxonomy_access_field_widget_term_reference_tree_after_build';
  $form_state['cardinality'] = $context['field']['cardinality'];
}

function _taxonomy_access_field_widget_term_reference_tree_after_build($element, &$form_state) {
  _taxonomy_access_configure_options_widget($element, $form_state['cardinality']);
  return $element;
}

Comments

GaëlG’s picture

This won't work for some non-required fields.

golds’s picture

Issue summary: View changes

I simply replaced the widget type when user can't see all taxonomy terms on this field.

/*  
 * Implements hook_field_widget_properties_alter()
 */
function MY_MODULE_field_widget_properties_alter(&$widget, $context) { 
  // Change a widget's type according to the term user permissions.
  if (module_exists('taxonomy_access')) {
    $field = $context['field'];
    if ($field['field_name'] == YOUR_FIELD_NAME) {
      if (isset($field['settings']['allowed_values'][0]['vocabulary'])) { 
        $vocab = $field['settings']['allowed_values'][0]['vocabulary'];
        $vocab = taxonomy_vocabulary_machine_name_load($vocab); 
        $allowed = _taxonomy_access_user_term_grants(TRUE, array($vocab->vid));
        if ($allowed === TRUE) {
          return ;
        } 
        $widget = array(
          'type' => 'options_select',
          'module' => 'options',
          'weight' => 0
        );
      }
    }  
  }
  
}