Skip to content

Commit

Permalink
Fix bug with Proxy classes.
Browse files Browse the repository at this point in the history
  • Loading branch information
nilov authored Jan 18, 2017
1 parent efd9a09 commit f61495a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Security/AccessHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -247,4 +252,4 @@ private function getTwigEnvironment()

return $this->twigEnvironment;
}
}
}

0 comments on commit f61495a

Please sign in to comment.