public function Access::access in Open Social 8
Same name and namespace in other branches
- 8.9 modules/custom/social_language/src/Access.php \Drupal\social_language\Access::access()
- 8.2 modules/custom/social_language/src/Access.php \Drupal\social_language\Access::access()
- 8.3 modules/custom/social_language/src/Access.php \Drupal\social_language\Access::access()
- 8.4 modules/custom/social_language/src/Access.php \Drupal\social_language\Access::access()
- 8.5 modules/custom/social_language/src/Access.php \Drupal\social_language\Access::access()
- 8.6 modules/custom/social_language/src/Access.php \Drupal\social_language\Access::access()
- 8.7 modules/custom/social_language/src/Access.php \Drupal\social_language\Access::access()
- 8.8 modules/custom/social_language/src/Access.php \Drupal\social_language\Access::access()
- 10.3.x modules/custom/social_language/src/Access.php \Drupal\social_language\Access::access()
- 10.0.x modules/custom/social_language/src/Access.php \Drupal\social_language\Access::access()
- 10.1.x modules/custom/social_language/src/Access.php \Drupal\social_language\Access::access()
- 10.2.x modules/custom/social_language/src/Access.php \Drupal\social_language\Access::access()
Checks access to the overview based on permissions and translatability.
Parameters
\Drupal\Core\Routing\RouteMatchInterface $route_match: The route_match to check against.
\Drupal\Core\Session\AccountInterface $account: The account to check access for.
string $permission: (optional) The permission.
File
- modules/
custom/ social_language/ src/ Access.php, line 45
Class
- Access
- Class Access.
Namespace
Drupal\social_languageCode
public function access(RouteMatchInterface $route_match, AccountInterface $account, $permission = NULL) {
if (count($this->languageManager
->getLanguages()) > 1) {
if (!empty($permission)) {
return AccessResult::allowedIfHasPermission($account, $permission);
}
else {
return AccessResult::allowed();
}
}
return AccessResult::forbidden();
}