public function ForumAccessCheck::access in Opigno forum 3.x
Same name and namespace in other branches
- 8 src/Access/ForumAccessCheck.php \Drupal\opigno_forum\Access\ForumAccessCheck::access()
Returns forum access.
File
- src/
Access/ ForumAccessCheck.php, line 18
Class
- ForumAccessCheck
- Checks access for displaying forum page.
Namespace
Drupal\opigno_forum\AccessCode
public function access(RouteMatch $route_match, AccountInterface $account) {
$forum = $route_match
->getParameter('taxonomy_term');
if ($forum !== NULL) {
if (!_opigno_forum_access($forum
->id(), $account)) {
return AccessResult::forbidden();
}
}
return AccessResult::allowed();
}