You are here

class CasRouteSubscriber in CAS 8

Same name and namespace in other branches
  1. 2.x src/Subscriber/CasRouteSubscriber.php \Drupal\cas\Subscriber\CasRouteSubscriber

Alters the user password reset routes.

Hierarchy

Expanded class hierarchy of CasRouteSubscriber

1 string reference to 'CasRouteSubscriber'
cas.services.yml in ./cas.services.yml
cas.services.yml
1 service uses CasRouteSubscriber
cas.route_subscriber in ./cas.services.yml
Drupal\cas\Subscriber\CasRouteSubscriber

File

src/Subscriber/CasRouteSubscriber.php, line 11

Namespace

Drupal\cas\Subscriber
View source
class CasRouteSubscriber extends RouteSubscriberBase {

  /**
   * {@inheritdoc}
   */
  protected function alterRoutes(RouteCollection $collection) {
    foreach ([
      'user.pass',
      'user.pass.http',
    ] as $route_name) {
      $collection
        ->get($route_name)
        ->setRequirement('_cas_user_access', 'TRUE');
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CasRouteSubscriber::alterRoutes protected 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