Access check for menu link delete routes.
Expanded class hierarchy of DeleteLinkAccessCheck
class DeleteLinkAccessCheck implements AccessCheckInterface {
/**
* {@inheritdoc}
*/
public function applies(Route $route) {
return array_key_exists('_access_menu_delete_link', $route
->getRequirements());
}
/**
* {@inheritdoc}
*/
public function access(Route $route, Request $request) {
if (user_access('administer menu') && ($menu_link = $request->attributes
->get('menu_link'))) {
// Links defined via hook_menu may not be deleted. Updated items are an
// exception, as they can be broken.
return $menu_link->module !== 'system' || $menu_link->updated;
}
return FALSE;
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AccessCheckInterface:: |
constant | Grant access. | ||
AccessCheckInterface:: |
constant | Deny access. | ||
AccessCheckInterface:: |
constant | Block access. | ||
DeleteLinkAccessCheck:: |
public | function |
Checks for access to route. Overrides AccessCheckInterface:: |
|
DeleteLinkAccessCheck:: |
public | function |
Declares whether the access check applies to a specific route or not. Overrides AccessCheckInterface:: |