summaryrefslogtreecommitdiff
path: root/src/Middleware
diff options
context:
space:
mode:
Diffstat (limited to 'src/Middleware')
-rw-r--r--src/Middleware/LegacyMiddleware.php6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/Middleware/LegacyMiddleware.php b/src/Middleware/LegacyMiddleware.php
index ce1eadef..b1315fda 100644
--- a/src/Middleware/LegacyMiddleware.php
+++ b/src/Middleware/LegacyMiddleware.php
@@ -62,7 +62,6 @@ class LegacyMiddleware implements MiddlewareInterface
ServerRequestInterface $request,
RequestHandlerInterface $handler
): ResponseInterface {
- global $privileges;
global $page;
/** @var Request $appRequest */
@@ -79,10 +78,7 @@ class LegacyMiddleware implements MiddlewareInterface
$title = $content = '';
if (
preg_match('~^\w+$~i', $page)
- && (
- in_array($page, $this->free_pages)
- || (isset($privileges) && in_array($page, $privileges))
- )
+ && (in_array($page, $this->free_pages) || $this->auth->can($page))
) {
list($title, $content) = $this->loadPage($page);
}