roles[] = 'root'; $user->save(); // Don't do anything else during config sync. if (\Drupal::isConfigSyncing()) { return; } }