From f61495ab27baa96a51d53071ba85fa2ff082f82f Mon Sep 17 00:00:00 2001 From: Andrey Date: Wed, 18 Jan 2017 09:25:35 +0700 Subject: [PATCH] Fix bug with Proxy classes. --- Security/AccessHandler.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Security/AccessHandler.php b/Security/AccessHandler.php index 67db481..ea1accb 100644 --- a/Security/AccessHandler.php +++ b/Security/AccessHandler.php @@ -198,6 +198,11 @@ public function getAccessAnnotation($class) $reflectionClass = new \ReflectionClass($reflectionClass); } + // If is a Proxy + if (in_array(Proxy::class, $reflectionClass->getInterfaceNames())) { + $reflectionClass = new \ReflectionClass($reflectionClass->getParentClass()->getName()); + } + self::$accessAnnotationCache[$className] = $this->annotationReader->getClassAnnotation( $reflectionClass, 'Glavweb\SecurityBundle\Mapping\Annotation\Access' @@ -247,4 +252,4 @@ private function getTwigEnvironment() return $this->twigEnvironment; } -} \ No newline at end of file +}