Add field to user management.

This commit is contained in:
James Cole
2021-08-30 06:37:55 +02:00
parent a08440aacf
commit 30d155a8e2
7 changed files with 40 additions and 2 deletions

View File

@@ -262,7 +262,7 @@ class UserEventHandler
$user = $event->user;
// create a new group.
$group = UserGroup::create(['title' => $user->email]);
$role = UserRole::where('title', UserRole::FULL)->first();
$role = UserRole::where('title', UserRole::OWNER)->first();
if (null === $role) {
throw new FireflyException('The user role is unexpectedly empty. Did you run all migrations?');
}
@@ -273,6 +273,8 @@ class UserEventHandler
'user_role_id' => $role->id,
]
);
$user->user_group_id = $group->id;
$user->save();
return true;
}