You are here

public function MigrateAccessCheck::checkAccess in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/migrate_drupal_ui/src/MigrateAccessCheck.php \Drupal\migrate_drupal_ui\MigrateAccessCheck::checkAccess()
  2. 9 core/modules/migrate_drupal_ui/src/MigrateAccessCheck.php \Drupal\migrate_drupal_ui\MigrateAccessCheck::checkAccess()

Checks if the user is user 1 and grants access if so.

Parameters

\Drupal\Core\Session\AccountInterface $account: The current user account.

Return value

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

1 string reference to 'MigrateAccessCheck::checkAccess'
migrate_drupal_ui.routing.yml in core/modules/migrate_drupal_ui/migrate_drupal_ui.routing.yml
core/modules/migrate_drupal_ui/migrate_drupal_ui.routing.yml

File

core/modules/migrate_drupal_ui/src/MigrateAccessCheck.php, line 29

Class

MigrateAccessCheck
Checks access for migrate_drupal_ui routes.

Namespace

Drupal\migrate_drupal_ui

Code

public function checkAccess(AccountInterface $account) {

  // The access result is uncacheable because it is just limiting access to
  // the migrate UI which is not worth caching.
  return AccessResultAllowed::allowedIf((int) $account
    ->id() === 1)
    ->mergeCacheMaxAge(0);
}