You are here

public function MenuLinkResetForm::linkIsResettable in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/menu_ui/src/Form/MenuLinkResetForm.php \Drupal\menu_ui\Form\MenuLinkResetForm::linkIsResettable()
  2. 9 core/modules/menu_ui/src/Form/MenuLinkResetForm.php \Drupal\menu_ui\Form\MenuLinkResetForm::linkIsResettable()

Checks access based on whether the link can be reset.

Parameters

\Drupal\Core\Menu\MenuLinkInterface $menu_link_plugin: The menu link plugin being checked.

Return value

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

1 string reference to 'MenuLinkResetForm::linkIsResettable'
menu_ui.routing.yml in core/modules/menu_ui/menu_ui.routing.yml
core/modules/menu_ui/menu_ui.routing.yml

File

core/modules/menu_ui/src/Form/MenuLinkResetForm.php, line 118

Class

MenuLinkResetForm
Defines a confirmation form for resetting a single modified menu link.

Namespace

Drupal\menu_ui\Form

Code

public function linkIsResettable(MenuLinkInterface $menu_link_plugin) {
  return AccessResult::allowedIf($menu_link_plugin
    ->isResettable())
    ->setCacheMaxAge(0);
}