You are here

class RouteSubscriber in Comment Permissions 8

Route subscriber event listener.

Hierarchy

Expanded class hierarchy of RouteSubscriber

1 string reference to 'RouteSubscriber'
comment_perm.services.yml in ./comment_perm.services.yml
comment_perm.services.yml
1 service uses RouteSubscriber
comment_perm.route_subscriber in ./comment_perm.services.yml
Drupal\comment_perm\Routing\RouteSubscriber

File

src/Routing/RouteSubscriber.php, line 11

Namespace

Drupal\comment_perm\Routing
View source
class RouteSubscriber extends RouteSubscriberBase {

  /**
   * {@inheritdoc}
   */
  public function alterRoutes(RouteCollection $collection) {
    if ($route = $collection
      ->get('comment.reply')) {
      $route
        ->setRequirement('_custom_access', '\\Drupal\\comment_perm\\Access\\CommentAccess::replyFormAccess');
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RouteSubscriber::alterRoutes public function Alters existing routes for a specific collection. Overrides RouteSubscriberBase::alterRoutes
RouteSubscriberBase::getSubscribedEvents public static function Returns an array of event names this subscriber wants to listen to. 5
RouteSubscriberBase::onAlterRoutes public function Delegates the route altering to self::alterRoutes(). 1