RouteSubscriber.php in Comment Permissions 8
Namespace
Drupal\comment_perm\RoutingFile
src/Routing/RouteSubscriber.phpView source
<?php
namespace Drupal\comment_perm\Routing;
use Drupal\Core\Routing\RouteSubscriberBase;
use Symfony\Component\Routing\RouteCollection;
/**
* Route subscriber event listener.
*/
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');
}
}
}
Classes
Name | Description |
---|---|
RouteSubscriber | Route subscriber event listener. |