comment_perm-8.x-1.x-dev/src/Routing/RouteSubscriber.php

src/Routing/RouteSubscriber.php
<?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');
    }
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc