class ForumAccessCheck in Opigno forum 8
Same name and namespace in other branches
- 3.x src/Access/ForumAccessCheck.php \Drupal\opigno_forum\Access\ForumAccessCheck
Checks access for displaying forum page.
Hierarchy
- class \Drupal\opigno_forum\Access\ForumAccessCheck implements AccessInterface
Expanded class hierarchy of ForumAccessCheck
1 string reference to 'ForumAccessCheck'
1 service uses ForumAccessCheck
File
- src/
Access/ ForumAccessCheck.php, line 13
Namespace
Drupal\opigno_forum\AccessView source
class ForumAccessCheck implements AccessInterface {
/**
* Returns forum access.
*/
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();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ForumAccessCheck:: |
public | function | Returns forum access. |