diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 471f72086..2d6fd7669 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -67,5 +67,7 @@ public function register(IRegistrationContext $context): void { $context->registerMiddleware(WorkspaceAccessControlMiddleware::class); $context->registerMiddleware(IsSpaceAdminMiddleware::class); + $context->registerMiddleware(IsGeneralManagerMiddleware::class); } + } diff --git a/lib/Middleware/IsGeneralManagerMiddleware.php b/lib/Middleware/IsGeneralManagerMiddleware.php index b36a66bb3..346899770 100644 --- a/lib/Middleware/IsGeneralManagerMiddleware.php +++ b/lib/Middleware/IsGeneralManagerMiddleware.php @@ -52,7 +52,7 @@ public function beforeController($controller, $methodName): void { return; } - public function afterException($controller, $methodName, Exception $exception): void { + public function afterException($controller, $methodName, Exception $exception): JSONResponse { if ($exception instanceof AccessDeniedException) { return new JSONResponse([ 'status' => 'forbidden',