You are here

function block_token_route_access in Block Token 8

Route access callback

File

./block_token.module, line 210
Defines necessary hooks and functions for block_token form.

Code

function block_token_route_access() {

  // Admin: always.
  if (Drupal::currentUser()
    ->hasPermission('administer taxonomy')) {
    return AccessResult::allowed();
  }
  if (Drupal::currentUser()
    ->hasPermission('administer block token')) {
    return AccessResult::allowed();
  }
  return AccessResult::forbidden();
}