fix(install): add created superadmin to most powerful group in instance, ie. superadmin

This commit is contained in:
Yassine Doghri 2024-01-15 14:32:32 +00:00
parent 19799f496d
commit 2ed511f8a0
1 changed files with 5 additions and 0 deletions

View File

@ -98,6 +98,11 @@ class CreateSuperadmin extends BaseCommand
$user = new User($data);
$userModel->save($user);
$user = $userModel->findById($userModel->getInsertID());
// set newly created user as most powerful instance group (superadmin)
$user->addGroup(setting('AuthGroups.mostPowerfulGroup'));
$this->write('Super admin "' . $username . '" created', 'green');
}