function MigrateAccessCheck::checkAccess
Same name in other branches
- 8.9.x core/modules/migrate_drupal_ui/src/MigrateAccessCheck.php \Drupal\migrate_drupal_ui\MigrateAccessCheck::checkAccess()
- 10 core/modules/migrate_drupal_ui/src/MigrateAccessCheck.php \Drupal\migrate_drupal_ui\MigrateAccessCheck::checkAccess()
- 11.x 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_uiCode
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);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.