diff --git a/src/AclRepository.php b/src/AclRepository.php index b32161c..12ac33b 100644 --- a/src/AclRepository.php +++ b/src/AclRepository.php @@ -155,6 +155,16 @@ public function __invoke(ServerRequestInterface $requestInterface, ResponseInter } } + //This is likely Slim 3 specific code... + $route = $requestInterface->getAttribute('route'); + if (!empty($route)) { + foreach ($this->role as $role) { + if ($this->isAllowed($role, $route->getPattern())) { + $allowed = true; + } + } + } + if ($allowed) { return $next($requestInterface, $responseInterface); } else {