Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Fix middleware for admin area.
James Cole6cfd8273fee8
diff --git a/bootstrap/app.php b/bootstrap/app.phpindex a370317a50..77fe016638 100644--- a/bootstrap/app.php+++ b/bootstrap/app.php@@ -156,8 +156,13 @@ $app = Application::configure(basePath: dirname(__DIR__))]);// This middleware is added to ensure that the user is not only logged in and// authenticated (with MFA and everything), but also admin.+ $middleware->appendToGroup('api-admin', [+ IsAdmin::class,+ ]);$middleware->appendToGroup('admin', [IsAdmin::class,+ Range::class,+ InterestingMessage::class]);// if the user is not logged in, this group applies.diff --git a/routes/api.php b/routes/api.phpindex a74fe1d8e1..f8a91a7126 100644--- a/routes/api.php+++ b/routes/api.php@@ -347,7 +347,7 @@ Route::group('namespace' => 'FireflyIII\Api\V1\Controllers\Models\UserGroup','prefix' => 'v1/user-groups','as' => 'api.v1.user-groups.',- 'middleware' => ['admin'],+ 'middleware' => ['api-admin'],],static function (): void {Route::get('', ['uses' => 'IndexController@index', 'as' => 'index']);@@ -724,7 +724,7 @@ Route::group('namespace' => 'FireflyIII\Api\V1\Controllers\System','prefix' => 'v1/configuration','as' => 'api.v1.configuration.',- 'middleware' => ['admin'],+ 'middleware' => ['api-admin'],],static function (): void {Route::get('', ['uses' => 'ConfigurationController@index', 'as' => 'index']);@@ -738,7 +738,7 @@ Route::group('namespace' => 'FireflyIII\Api\V1\Controllers\System','prefix' => 'v1/users','as' => 'api.v1.users.',- 'middleware' => ['admin'],+ 'middleware' => ['api-admin'],],static function (): void {Route::get('', ['uses' => 'UserController@index', 'as' => 'index']);