You are here

function taxonomy_access_create_allowed in Taxonomy Access Control 7

Filter a list of term IDs to terms the user may create.

Parameters

array $tids: The array of term IDs.

Return value

array An array of disallowed term IDs.

Related topics

1 call to taxonomy_access_create_allowed()
_taxonomy_access_options_alter in ./taxonomy_access.create.inc
Implements the create grant for options widgets.

File

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

Code

function taxonomy_access_create_allowed(array $tids) {
  $all_allowed = taxonomy_access_user_create_terms();

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