class DbUpdateAccessCheck in Drupal 10
Same name and namespace in other branches
- 8 core/modules/system/src/Access/DbUpdateAccessCheck.php \Drupal\system\Access\DbUpdateAccessCheck
- 9 core/modules/system/src/Access/DbUpdateAccessCheck.php \Drupal\system\Access\DbUpdateAccessCheck
Access check for database update routes.
Hierarchy
- class \Drupal\system\Access\DbUpdateAccessCheck implements AccessInterface
Expanded class hierarchy of DbUpdateAccessCheck
1 string reference to 'DbUpdateAccessCheck'
- system.services.yml in core/
modules/ system/ system.services.yml - core/modules/system/system.services.yml
1 service uses DbUpdateAccessCheck
- access_check.db_update in core/
modules/ system/ system.services.yml - Drupal\system\Access\DbUpdateAccessCheck
File
- core/
modules/ system/ src/ Access/ DbUpdateAccessCheck.php, line 13
Namespace
Drupal\system\AccessView source
class DbUpdateAccessCheck implements AccessInterface {
/**
* Checks access for update routes.
*
* @param \Drupal\Core\Session\AccountInterface $account
* The currently logged in account.
*
* @return \Drupal\Core\Access\AccessResultInterface
* The access result.
*/
public function access(AccountInterface $account) {
// Allow the global variable in settings.php to override the access check.
if (Settings::get('update_free_access')) {
return AccessResult::allowed()
->setCacheMaxAge(0);
}
if ($account
->hasPermission('administer software updates')) {
return AccessResult::allowed()
->cachePerPermissions();
}
else {
return AccessResult::forbidden()
->cachePerPermissions();
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DbUpdateAccessCheck:: |
public | function | Checks access for update routes. |