You are here

public function WeatherUserConfiguredDisplayController::access in Weather 8

Same name and namespace in other branches
  1. 2.0.x src/Controller/WeatherUserConfiguredDisplayController.php \Drupal\weather\Controller\WeatherUserConfiguredDisplayController::access()

Checks access for a specific request.

Parameters

\Drupal\Core\Session\AccountInterface $account: Run access checks for this account.

Return value

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

1 string reference to 'WeatherUserConfiguredDisplayController::access'
weather.routing.yml in ./weather.routing.yml
weather.routing.yml

File

src/Controller/WeatherUserConfiguredDisplayController.php, line 143

Class

WeatherUserConfiguredDisplayController
Returns responses for Weather routes.

Namespace

Drupal\weather\Controller

Code

public function access(AccountInterface $account, UserInterface $user) {
  return AccessResult::allowedIf($user
    ->id() == $account
    ->id() && $account
    ->hasPermission('administer custom weather block'));
}