You are here

public function MergeAccess::access in Term Merge 8

Checks access for a specific request.

Parameters

\Drupal\taxonomy\Entity\Vocabulary $taxonomy_vocabulary: Run access checks against this vocabulary.

\Drupal\Core\Session\AccountInterface $account: Run access checks for this account.

Return value

\Drupal\Core\Access\AccessResultInterface The access result.

File

src/Access/MergeAccess.php, line 26

Class

MergeAccess
Verifies that a given user is allowed to merge terms.

Namespace

Drupal\term_merge\Access

Code

public function access(Vocabulary $taxonomy_vocabulary, AccountInterface $account) {
  return AccessResult::allowedIfHasPermission($account, 'edit terms in ' . $taxonomy_vocabulary
    ->id());
}