public function UserSettingsAccess::access in Notify 8
Same name and namespace in other branches
- 2.0.x src/Access/UserSettingsAccess.php \Drupal\notify\Access\UserSettingsAccess::access()
- 1.0.x src/Access/UserSettingsAccess.php \Drupal\notify\Access\UserSettingsAccess::access()
Checks access for the UserSettings form.
Parameters
\Drupal\Core\Routing\RouteMatchInterface $route_match: The route match.
\Drupal\Core\Session\AccountInterface $account: Run access checks for this account.
Return value
\Drupal\Core\Access\AccessResultInterface The access result.
1 string reference to 'UserSettingsAccess::access'
File
- src/
Access/ UserSettingsAccess.php, line 27
Class
- UserSettingsAccess
- Class UserSettingsAccess.
Namespace
Drupal\notify\AccessCode
public function access(RouteMatchInterface $route_match, AccountInterface $account) {
$current_user = $route_match
->getParameter('user');
if ($current_user === $account
->id()) {
return AccessResult::allowedIf($account
->hasPermission('access notify'));
}
return AccessResult::allowedIf($account
->hasPermission('administer notify'));
}