Skip to content

Commit

Permalink
Merge pull request #965 from arawa/fix/964/need-registering-isgeneral…
Browse files Browse the repository at this point in the history
…managermiddleware

registering IsGeneralManagerMiddleware
  • Loading branch information
zak39 authored Jul 16, 2024
2 parents 0436f26 + ff4e11b commit 699eba5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,7 @@ public function register(IRegistrationContext $context): void {

$context->registerMiddleware(WorkspaceAccessControlMiddleware::class);
$context->registerMiddleware(IsSpaceAdminMiddleware::class);
$context->registerMiddleware(IsGeneralManagerMiddleware::class);
}

}
2 changes: 1 addition & 1 deletion lib/Middleware/IsGeneralManagerMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 699eba5

Please sign in to comment.