public function WeatherUserConfiguredDisplayController::access in Weather 2.0.x
Same name and namespace in other branches
- 8 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.
\Drupal\user\UserInterface $user: The user.
Return value
\Drupal\Core\Access\AccessResultInterface The access result.
1 string reference to 'WeatherUserConfiguredDisplayController::access'
File
- src/
Controller/ WeatherUserConfiguredDisplayController.php, line 145
Class
- WeatherUserConfiguredDisplayController
- Returns responses for Weather routes.
Namespace
Drupal\weather\ControllerCode
public function access(AccountInterface $account, UserInterface $user) {
return AccessResult::allowedIf($user
->id() == $account
->id() && $account
->hasPermission('administer custom weather block'));
}