You are here

function taxonomy_access_user_create_terms_by_vocab in Taxonomy Access Control 7

Retrieve terms that the current user may create in specific vocabularies.

Parameters

int $vid: A vid to use as a filter.

Return value

array|true An array of term IDs, or TRUE if the user may create all terms.

See also

taxonomy_access_user_create_terms()

_taxonomy_access_user_term_grants()

Related topics

1 call to taxonomy_access_user_create_terms_by_vocab()
_taxonomy_access_autocomplete_alter in ./taxonomy_access.create.inc
Implements the create grant for autocomplete fields.

File

./taxonomy_access.create.inc, line 243
Implements the Add Tag (create) grant on editing forms.

Code

function taxonomy_access_user_create_terms_by_vocab($vid) {

  // Cache the terms the current user can create per vocabulary.
  static $terms = array();
  if (!isset($terms[$vid])) {
    $terms[$vid] = _taxonomy_access_user_term_grants(TRUE, array(
      $vid,
    ));
  }
  return $terms[$vid];
}