class ForumAccessCheck in Opigno forum 3.x
Same name and namespace in other branches
- 8 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. |