You are here

class ForumAccessCheck in Opigno forum 8

Same name and namespace in other branches
  1. 3.x src/Access/ForumAccessCheck.php \Drupal\opigno_forum\Access\ForumAccessCheck

Checks access for displaying forum page.

Hierarchy

Expanded class hierarchy of ForumAccessCheck

1 string reference to 'ForumAccessCheck'
opigno_forum.services.yml in ./opigno_forum.services.yml
opigno_forum.services.yml
1 service uses ForumAccessCheck
opigno_forum.access_checker in ./opigno_forum.services.yml
Drupal\opigno_forum\Access\ForumAccessCheck

File

src/Access/ForumAccessCheck.php, line 13

Namespace

Drupal\opigno_forum\Access
View 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

Namesort descending Modifiers Type Description Overrides
ForumAccessCheck::access public function Returns forum access.