James Cole
2024-04-23 16:24:46 +02:00
parent f15ca1d0a1
commit 3d410556ef
3 changed files with 5 additions and 4 deletions

View File

@@ -80,7 +80,7 @@ class CreateGroupMemberships extends Command
// check if membership exists // check if membership exists
$userGroup = UserGroup::where('title', $user->email)->first(); $userGroup = UserGroup::where('title', $user->email)->first();
if (null === $userGroup) { 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(); $userRole = UserRole::where('title', UserRoleEnum::OWNER->value)->first();

View File

@@ -98,7 +98,7 @@ class UserGroup extends Model
{ {
use ReturnsIntegerIdTrait; 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). * Route binder. Converts the key in the URL to the specified object (or throw 404).

View File

@@ -80,9 +80,10 @@ class RemoteUserProvider implements UserProvider
$roleObject = Role::where('name', 'owner')->first(); $roleObject = Role::where('name', 'owner')->first();
$user->roles()->attach($roleObject); $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)); app('log')->debug(sprintf('Going to return user #%d (%s)', $user->id, $user->email));
return $user; return $user;