You are here

AccessDenied.php in Rabbit Hole 2.x

Same filename and directory in other branches
  1. 8 src/Plugin/RabbitHoleBehaviorPlugin/AccessDenied.php

File

src/Plugin/RabbitHoleBehaviorPlugin/AccessDenied.php
View source
<?php

namespace Drupal\rabbit_hole\Plugin\RabbitHoleBehaviorPlugin;

use Drupal\Core\Entity\EntityInterface;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
use Symfony\Component\HttpFoundation\Response;
use Drupal\rabbit_hole\Plugin\RabbitHoleBehaviorPluginBase;

/**
 * Denies access to a page.
 *
 * @RabbitHoleBehaviorPlugin(
 *   id = "access_denied",
 *   label = @Translation("Access denied")
 * )
 */
class AccessDenied extends RabbitHoleBehaviorPluginBase {

  /**
   * {@inheritdoc}
   */
  public function performAction(EntityInterface $entity, Response $current_response = NULL) {
    throw new AccessDeniedHttpException();
  }

}

Classes

Namesort descending Description
AccessDenied Denies access to a page.