1. 8.5.x core/modules/user/src/Access/RegisterAccessCheck.php RegisterAccessCheck
  2. 8.0.x core/modules/user/src/Access/RegisterAccessCheck.php RegisterAccessCheck
  3. 8.1.x core/modules/user/src/Access/RegisterAccessCheck.php RegisterAccessCheck
  4. 8.2.x core/modules/user/src/Access/RegisterAccessCheck.php RegisterAccessCheck
  5. 8.3.x core/modules/user/src/Access/RegisterAccessCheck.php RegisterAccessCheck
  6. 8.4.x core/modules/user/src/Access/RegisterAccessCheck.php RegisterAccessCheck
  7. 8.6.x core/modules/user/src/Access/RegisterAccessCheck.php RegisterAccessCheck

Access check for user registration routes.

Hierarchy

Expanded class hierarchy of RegisterAccessCheck

1 string reference to 'RegisterAccessCheck'
user.services.yml in core/modules/user/user.services.yml
core/modules/user/user.services.yml
1 service uses RegisterAccessCheck

File

core/modules/user/src/Access/RegisterAccessCheck.php, line 12

Namespace

Drupal\user\Access
View source
class RegisterAccessCheck implements AccessInterface {

  /**
   * Checks access.
   *
   * @param \Drupal\Core\Session\AccountInterface $account
   *   The currently logged in account.
   *
   * @return \Drupal\Core\Access\AccessResultInterface
   *   The access result.
   */
  public function access(AccountInterface $account) {
    $user_settings = \Drupal::config('user.settings');
    return AccessResult::allowedIf($account
      ->isAnonymous() && $user_settings
      ->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY)
      ->cacheUntilConfigurationChanges($user_settings);
  }

}

Members

Contains filters are case sensitive