You are here

public function ApiDocReimportSpecForm::checkAccess in Apigee API Catalog 8.2

Checks access for the form page.

Parameters

\Drupal\Core\Routing\RouteMatchInterface $route_match: The route match.

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

Return value

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

1 string reference to 'ApiDocReimportSpecForm::checkAccess'
apigee_api_catalog.routing.yml in ./apigee_api_catalog.routing.yml
apigee_api_catalog.routing.yml

File

src/Entity/Form/ApiDocReimportSpecForm.php, line 103

Class

ApiDocReimportSpecForm
Class ApiDocReimportSpecForm.

Namespace

Drupal\apigee_api_catalog\Entity\Form

Code

public function checkAccess(RouteMatchInterface $route_match, AccountInterface $account) {

  /** @var \Drupal\node\NodeInterface $entity */
  $entity = $route_match
    ->getParameter('node');
  return AccessResult::allowedIf($entity
    ->bundle() == 'apidoc' && $entity
    ->access('update', $account));
}