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 +}