You are here

function taxonomy_access_create_default_allowed in Taxonomy Access Control 7

Filter a list of vocab IDs to those in which the user may create by default.

Parameters

array $vids: The array of vocabulary IDs.

Return value

array An array of disallowed vocabulary IDs.

Related topics

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

File

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

Code

function taxonomy_access_create_default_allowed(array $vids) {
  $all_allowed = taxonomy_access_user_create_defaults();

  // If the user's create grant info is exactly TRUE, all terms are allowed.
  if ($all_allowed === TRUE) {
    return $vids;
  }
  return array_intersect($vids, $all_allowed);
}