From 3d410556ef08a12ded7e5a098e0ca6c032558645 Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 23 Apr 2024 16:24:46 +0200 Subject: [PATCH] Fix https://github.com/firefly-iii/firefly-iii/issues/8812 --- app/Console/Commands/Integrity/CreateGroupMemberships.php | 2 +- app/Models/UserGroup.php | 2 +- app/Support/Authentication/RemoteUserProvider.php | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/Console/Commands/Integrity/CreateGroupMemberships.php b/app/Console/Commands/Integrity/CreateGroupMemberships.php index b5127c2791..0927f1b7cb 100644 --- a/app/Console/Commands/Integrity/CreateGroupMemberships.php +++ b/app/Console/Commands/Integrity/CreateGroupMemberships.php @@ -80,7 +80,7 @@ class CreateGroupMemberships extends Command // check if membership exists $userGroup = UserGroup::where('title', $user->email)->first(); if (null === $userGroup) { - $userGroup = UserGroup::create(['title' => $user->email, 'default_administration' => true]); + $userGroup = UserGroup::create(['title' => $user->email]); } $userRole = UserRole::where('title', UserRoleEnum::OWNER->value)->first(); diff --git a/app/Models/UserGroup.php b/app/Models/UserGroup.php index e24f8c3df5..34cf18f84e 100644 --- a/app/Models/UserGroup.php +++ b/app/Models/UserGroup.php @@ -98,7 +98,7 @@ class UserGroup extends Model { use ReturnsIntegerIdTrait; - protected $fillable = ['title', 'default_administration']; + protected $fillable = ['title']; /** * Route binder. Converts the key in the URL to the specified object (or throw 404). diff --git a/app/Support/Authentication/RemoteUserProvider.php b/app/Support/Authentication/RemoteUserProvider.php index 9d4443f0c8..a218dd5bfe 100644 --- a/app/Support/Authentication/RemoteUserProvider.php +++ b/app/Support/Authentication/RemoteUserProvider.php @@ -80,9 +80,10 @@ class RemoteUserProvider implements UserProvider $roleObject = Role::where('name', 'owner')->first(); $user->roles()->attach($roleObject); } - // make sure the user gets an administration as well. - CreateGroupMemberships::createGroupMembership($user); } + // make sure the user gets an administration as well. + CreateGroupMemberships::createGroupMembership($user); + app('log')->debug(sprintf('Going to return user #%d (%s)', $user->id, $user->email)); return $user;