function ContentTranslationDeleteAccess::access
Same name in other branches
- 9 core/modules/content_translation/src/Access/ContentTranslationDeleteAccess.php \Drupal\content_translation\Access\ContentTranslationDeleteAccess::access()
- 8.9.x core/modules/content_translation/src/Access/ContentTranslationDeleteAccess.php \Drupal\content_translation\Access\ContentTranslationDeleteAccess::access()
- 10 core/modules/content_translation/src/Access/ContentTranslationDeleteAccess.php \Drupal\content_translation\Access\ContentTranslationDeleteAccess::access()
Checks access to translation deletion for the specified route match.
Parameters
\Drupal\Core\Routing\RouteMatchInterface $route_match: The parameterized route.
\Drupal\Core\Session\AccountInterface $account: The currently logged in account.
Return value
\Drupal\Core\Access\AccessResultInterface The access result.
File
-
core/
modules/ content_translation/ src/ Access/ ContentTranslationDeleteAccess.php, line 65
Class
- ContentTranslationDeleteAccess
- Access check for entity translation deletion.
Namespace
Drupal\content_translation\AccessCode
public function access(RouteMatchInterface $route_match, AccountInterface $account) {
$requirement = $route_match->getRouteObject()
->getRequirement('_access_content_translation_delete');
$entity_type_id = current(explode('.', $requirement));
$entity = $route_match->getParameter($entity_type_id);
return $this->checkAccess($entity);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.