public Url::access(AccountInterface $account = NULL)
Checks this Url object against applicable access check services.
Determines whether the route is accessible or not.
\Drupal\Core\Session\AccountInterface $account: (optional) Run access checks for this account. Defaults to the current user.
bool Returns TRUE if the user has access to the url, otherwise FALSE.
public function access(AccountInterface $account = NULL) { if ($this->isRouted()) { return $this->accessManager()->checkNamedRoute($this->getRouteName(), $this->getRouteParameters(), $account); } return TRUE; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Url.php/function/Url::access/8.1.x