http://pms.cmet.ustc.edu.cn/admin/batch-college-attachment/list/31

Exceptions

Access Denied.

Exceptions 2

Symfony\Component\HttpKernel\Exception\ AccessDeniedHttpException

  1.         }
  2.     }
  3.     private function handleAccessDeniedException(ExceptionEvent $eventAccessDeniedException $exception)
  4.     {
  5.         $event->setThrowable(new AccessDeniedHttpException($exception->getMessage(), $exception));
  6.         $token $this->tokenStorage->getToken();
  7.         if (!$this->authenticationTrustResolver->isFullFledged($token)) {
  8.             if (null !== $this->logger) {
  9.                 $this->logger->debug('Access denied, the user is not fully authenticated; redirecting to authentication entry point.', ['exception' => $exception]);
in vendor/symfony/security-http/Firewall/ExceptionListener.php -> handleAccessDeniedException (line 103)
  1.                 return;
  2.             }
  3.             if ($exception instanceof AccessDeniedException) {
  4.                 $this->handleAccessDeniedException($event$exception);
  5.                 return;
  6.             }
  7.             if ($exception instanceof LazyResponseException) {
  1.         $this->priority $dispatcher->getListenerPriority($eventName$this->listener);
  2.         $e $this->stopwatch->start($this->name'event_listener');
  3.         try {
  4.             ($this->optimizedListener ?? $this->listener)($event$eventName$dispatcher);
  5.         } finally {
  6.             if ($e->isStarted()) {
  7.                 $e->stop();
  8.             }
  9.         }
  1.         foreach ($listeners as $listener) {
  2.             if ($stoppable && $event->isPropagationStopped()) {
  3.                 break;
  4.             }
  5.             $listener($event$eventName$this);
  6.         }
  7.     }
  8.     /**
  9.      * Sorts the internal list of listeners for the given event by priority.
  1.         } else {
  2.             $listeners $this->getListeners($eventName);
  3.         }
  4.         if ($listeners) {
  5.             $this->callListeners($listeners$eventName$event);
  6.         }
  7.         return $event;
  8.     }
  1.         try {
  2.             $this->beforeDispatch($eventName$event);
  3.             try {
  4.                 $e $this->stopwatch->start($eventName'section');
  5.                 try {
  6.                     $this->dispatcher->dispatch($event$eventName);
  7.                 } finally {
  8.                     if ($e->isStarted()) {
  9.                         $e->stop();
  10.                     }
  11.                 }
  1.      * @throws \Exception
  2.      */
  3.     private function handleThrowable(\Throwable $eRequest $requestint $type): Response
  4.     {
  5.         $event = new ExceptionEvent($this$request$type$e);
  6.         $this->dispatcher->dispatch($eventKernelEvents::EXCEPTION);
  7.         // a listener might have replaced the exception
  8.         $e $event->getThrowable();
  9.         if (!$event->hasResponse()) {
in vendor/symfony/http-kernel/HttpKernel.php -> handleThrowable (line 86)
  1.                 $this->finishRequest($request$type);
  2.                 throw $e;
  3.             }
  4.             return $this->handleThrowable($e$request$type);
  5.         } finally {
  6.             $this->requestStack->pop();
  7.         }
  8.     }
  1.         $this->boot();
  2.         ++$this->requestStackSize;
  3.         $this->resetServices true;
  4.         try {
  5.             return $this->getHttpKernel()->handle($request$type$catch);
  6.         } finally {
  7.             --$this->requestStackSize;
  8.         }
  9.     }
  1.         $this->request $request;
  2.     }
  3.     public function run(): int
  4.     {
  5.         $response $this->kernel->handle($this->request);
  6.         $response->send();
  7.         if ($this->kernel instanceof TerminableInterface) {
  8.             $this->kernel->terminate($this->request$response);
  9.         }
in vendor/autoload_runtime.php -> run (line 35)
  1. $app $app(...$args);
  2. exit(
  3.     $runtime
  4.         ->getRunner($app)
  5.         ->run()
  6. );
require_once('/home/projects/pms/vendor/autoload_runtime.php') in public/index.php (line 5)
  1. <?php
  2. use App\Kernel;
  3. require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
  4. return function (array $context) {
  5.     return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
  6. };

Symfony\Component\Security\Core\Exception\ AccessDeniedException

Access Denied.

  1.     {
  2.         if (!class_exists(AccessDeniedException::class)) {
  3.             throw new \LogicException('You cannot use the "createAccessDeniedException" method if the Security component is not available. Try running "composer require symfony/security-bundle".');
  4.         }
  5.         return new AccessDeniedException($message$previous);
  6.     }
  7.     /**
  8.      * Creates and returns a Form instance from the type of the form.
  9.      */
in vendor/symfony/framework-bundle/Controller/AbstractController.php -> createAccessDeniedException (line 241)
  1.      * @throws AccessDeniedException
  2.      */
  3.     protected function denyAccessUnlessGranted($attribute$subject nullstring $message 'Access Denied.'): void
  4.     {
  5.         if (!$this->isGranted($attribute$subject)) {
  6.             $exception $this->createAccessDeniedException($message);
  7.             $exception->setAttributes([$attribute]);
  8.             $exception->setSubject($subject);
  9.             throw $exception;
  10.         }
AbstractController->denyAccessUnlessGranted() in src/Controller/Admin/BatchCollegeAttachmentController.php (line 31)
  1.      * @Route("list/{id}", name="list", requirements={"id"="\d+"})
  2.      */
  3.     public function list(Batch $batchBatchCollegeAttachmentRepository $re): Response
  4.     {
  5.         $user $this->getUser();
  6.         $this->denyAccessUnlessGranted(BatchVoter::COLLEGE_ACTION$batch);
  7.         return $this->render('admin/batch_college_attachment/list.html.twig', [
  8.             'title' => $batch->getName() . ' - 学院附件列表',
  9.             'batch' => $batch,
  10.             'entities' => $re->findBy([
  11.                 'batch' => $batch,
  1.         $this->dispatcher->dispatch($eventKernelEvents::CONTROLLER_ARGUMENTS);
  2.         $controller $event->getController();
  3.         $arguments $event->getArguments();
  4.         // call controller
  5.         $response $controller(...$arguments);
  6.         // view
  7.         if (!$response instanceof Response) {
  8.             $event = new ViewEvent($this$request$type$response);
  9.             $this->dispatcher->dispatch($eventKernelEvents::VIEW);
  1.     {
  2.         $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  3.         $this->requestStack->push($request);
  4.         try {
  5.             return $this->handleRaw($request$type);
  6.         } catch (\Exception $e) {
  7.             if ($e instanceof RequestExceptionInterface) {
  8.                 $e = new BadRequestHttpException($e->getMessage(), $e);
  9.             }
  10.             if (false === $catch) {
  1.         $this->boot();
  2.         ++$this->requestStackSize;
  3.         $this->resetServices true;
  4.         try {
  5.             return $this->getHttpKernel()->handle($request$type$catch);
  6.         } finally {
  7.             --$this->requestStackSize;
  8.         }
  9.     }
  1.         $this->request $request;
  2.     }
  3.     public function run(): int
  4.     {
  5.         $response $this->kernel->handle($this->request);
  6.         $response->send();
  7.         if ($this->kernel instanceof TerminableInterface) {
  8.             $this->kernel->terminate($this->request$response);
  9.         }
in vendor/autoload_runtime.php -> run (line 35)
  1. $app $app(...$args);
  2. exit(
  3.     $runtime
  4.         ->getRunner($app)
  5.         ->run()
  6. );
require_once('/home/projects/pms/vendor/autoload_runtime.php') in public/index.php (line 5)
  1. <?php
  2. use App\Kernel;
  3. require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
  4. return function (array $context) {
  5.     return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
  6. };

Stack Traces 2

[2/2] AccessDeniedHttpException
Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException:
Access Denied.

  at vendor/symfony/security-http/Firewall/ExceptionListener.php:138
  at Symfony\Component\Security\Http\Firewall\ExceptionListener->handleAccessDeniedException()
     (vendor/symfony/security-http/Firewall/ExceptionListener.php:103)
  at Symfony\Component\Security\Http\Firewall\ExceptionListener->onKernelException()
     (vendor/symfony/event-dispatcher/Debug/WrappedListener.php:118)
  at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke()
     (vendor/symfony/event-dispatcher/EventDispatcher.php:230)
  at Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
     (vendor/symfony/event-dispatcher/EventDispatcher.php:59)
  at Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
     (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:154)
  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch()
     (vendor/symfony/http-kernel/HttpKernel.php:223)
  at Symfony\Component\HttpKernel\HttpKernel->handleThrowable()
     (vendor/symfony/http-kernel/HttpKernel.php:86)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (vendor/autoload_runtime.php:35)
  at require_once('/home/projects/pms/vendor/autoload_runtime.php')
     (public/index.php:5)                
[1/2] AccessDeniedException
Symfony\Component\Security\Core\Exception\AccessDeniedException:
Access Denied.

  at vendor/symfony/framework-bundle/Controller/AbstractController.php:358
  at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->createAccessDeniedException()
     (vendor/symfony/framework-bundle/Controller/AbstractController.php:241)
  at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->denyAccessUnlessGranted()
     (src/Controller/Admin/BatchCollegeAttachmentController.php:31)
  at App\Controller\Admin\BatchCollegeAttachmentController->list()
     (vendor/symfony/http-kernel/HttpKernel.php:163)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:75)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (vendor/autoload_runtime.php:35)
  at require_once('/home/projects/pms/vendor/autoload_runtime.php')
     (public/index.php:5)