function taxonomy_term_access

Access callback: Checks a user's permission for performing a taxonomy term operation.

Parameters

$op: The operation to be performed on the taxonomy term. Possible values are:

  • "edit"
  • "delete"

$term: The $term object on which the operation is to be performed.

Return value

TRUE if the operation may be performed, FALSE otherwise.

See also

taxonomy_menu()

1 call to taxonomy_term_access()
LinkEdit::render in drupal/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/field/LinkEdit.php
Render the field.
1 string reference to 'taxonomy_term_access'
taxonomy_menu in drupal/core/modules/taxonomy/taxonomy.module
Implements hook_menu().

File

drupal/core/modules/taxonomy/taxonomy.module, line 383
Enables the organization of content into categories.

Code

function taxonomy_term_access($op, $term) {
  if (!$term || !in_array($op, array(
    'edit',
    'delete',
  ), TRUE)) {

    // If there was no term to check against, or the $op was not one of the
    // supported ones, we return access denied.
    return FALSE;
  }
  return user_access("{$op} terms in {$term->vid}") || user_access('administer taxonomy');
}