1 taxonomy.entity.inc public static TaxonomyTerm::createAccess($bundle = NULL, $account = NULL)

Overrides Entity::createAccess().

Overrides Entity::createAccess

File

core/modules/taxonomy/taxonomy.entity.inc, line 117
Entity classes and controllers for Taxonomy module.

Class

TaxonomyTerm
Defines the taxonomy term entity.

Code

public static function createAccess($bundle = NULL, $account = NULL) {
  // If no user object is supplied, the access check is for the current user.
  if (empty($account)) {
    $account = $GLOBALS['user'];
  }

  $admin_access = user_access('administer taxonomy', $account);
  if (!empty($bundle)) {
    return user_access("create terms in $bundle", $account) || $admin_access;
  }
  return $admin_access;
}