Example #1
0
 /** @return boolean */
 public function isGranted(RouteMatch $routeMatch)
 {
     $allowedRoles = $this->getAllowedRoles($routeMatch);
     if (!$allowedRoles) {
         return false;
     }
     if (in_array('*', $allowedRoles)) {
         return true;
     }
     $matchingRoles = array_intersect($allowedRoles, $this->identityProvider->getIdentity()->getRoles());
     if (count($matchingRoles)) {
         return true;
     }
     return false;
 }
Example #2
0
 /** @return IdentityInterface */
 public function getIdentity()
 {
     return $this->identityProvider->getIdentity();
 }