mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-07-23 16:04:46 -07:00
Fix middleware for admin area.
This commit is contained in:
@@ -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.
|
||||
|
||||
+3
-3
@@ -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']);
|
||||
|
||||
Reference in New Issue
Block a user