James Cole 2024-04-23 16:24:46 +02:00
parent f15ca1d0a1
commit 3d410556ef
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80
3 changed files with 5 additions and 4 deletions

View File

@ -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();

View File

@ -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).

View File

@ -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;